diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index cae67673e91f2e7625a641b78b22c2de9eff557d..bc3729199e56c1b4216738294428895c4c6ca8a1 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -492,7 +492,23 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { */ pSql->fp = pSql->fetchFp; // restore the fp tscHandleInsertRetry(pSql); - } else {// in case of other query type, continue + } else if (pCmd->command == TSDB_SQL_SELECT) { // in case of other query type, continue + tscDebug("%p redo parse sql string and proceed", pSql); + //tscDebug("before %p fp:%p, fetchFp:%p", pSql, pSql->fp, pSql->fetchFp); + pCmd->parseFinished = false; + tscResetSqlCmdObj(pCmd); + + //tscDebug("after %p fp:%p, fetchFp:%p", pSql, pSql->fp, pSql->fetchFp); + code = tsParseSql(pSql, true); + + if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { + return; + } else if (code != TSDB_CODE_SUCCESS) { + goto _error; + } + + tscProcessSql(pSql); + } else { // in all other cases, simple retry tscProcessSql(pSql); }