[td-225] fix bugs in join query.

This commit is contained in:
Haojun Liao 2020-07-29 18:04:20 +08:00
parent 6fd03c905d
commit e8f9f503fc
2 changed files with 5 additions and 4 deletions

View File

@ -419,7 +419,6 @@ char *tscGetErrorMsgPayload(SSqlCmd *pCmd);
int32_t tscInvalidSQLErrMsg(char *msg, const char *additionalInfo, const char *sql);
int32_t tscToSQLCmd(SSqlObj *pSql, struct SSqlInfo *pInfo);
//void tscGetResultColumnChr(SSqlRes *pRes, SFieldInfo* pFieldInfo, int32_t column);
static FORCE_INLINE void tscGetResultColumnChr(SSqlRes* pRes, SFieldInfo* pFieldInfo, int32_t columnIndex) {
SFieldSupInfo* pInfo = (SFieldSupInfo*) TARRAY_GET_ELEM(pFieldInfo->pSupportInfo, columnIndex);

View File

@ -1054,6 +1054,10 @@ void tscSetupOutputColumnIndex(SSqlObj* pSql) {
}
}
}
// restore the offset value for super table query in case of final result.
tscRestoreSQLFuncForSTableQuery(pQueryInfo);
tscFieldInfoUpdateOffset(pQueryInfo);
}
void tscJoinQueryCallback(void* param, TAOS_RES* tres, int code) {
@ -2046,9 +2050,7 @@ void tscBuildResFromSubqueries(SSqlObj *pSql) {
}
while (1) {
if (pRes->row < pRes->numOfRows) {
assert(0);
}
assert (pRes->row >= pRes->numOfRows);
doBuildResFromSubqueries(pSql);
sem_post(&pSql->rspSem);