diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 8c194c031d81d899af22b0be90be87072d8a8b51..b856752db31acb4d0f3a9b8bd02210abd1c12cca 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -474,33 +474,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { // in case of insert, redo parsing the sql string and build new submit data block for two reasons: // 1. the table Id(tid & uid) may have been update, the submit block needs to be updated accordingly. // 2. vnode may need the schema information along with submit block to update its local table schema. - if (pCmd->command == TSDB_SQL_INSERT) { - tscDebug("%p redo parse sql string to build submit block", pSql); - - pCmd->parseFinished = false; - tscResetSqlCmdObj(pCmd); - - code = tsParseSql(pSql, true); - - if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { - return; - } else if (code != TSDB_CODE_SUCCESS) { - goto _error; - } - - /* - * Discard previous built submit blocks, and then parse the sql string again and build up all submit blocks, - * and send the required submit block according to index value in supporter to server. - */ - pSql->fp = pSql->fetchFp; // restore the fp - tscHandleInsertRetry(pSql); - } else if (pCmd->command == TSDB_SQL_SELECT) { // in case of other query type, continue + if (pCmd->command == TSDB_SQL_INSERT || pCmd->command == TSDB_SQL_SELECT) { 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) { @@ -509,8 +487,17 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { goto _error; } - tscProcessSql(pSql); - } else { // in all other cases, simple retry + if (pCmd->command == TSDB_SQL_INSERT) { + /* + * Discard previous built submit blocks, and then parse the sql string again and build up all submit blocks, + * and send the required submit block according to index value in supporter to server. + */ + pSql->fp = pSql->fetchFp; // restore the fp + tscHandleInsertRetry(pSql); + } else if (pCmd->command == TSDB_SQL_SELECT) { // in case of other query type, continue + tscProcessSql(pSql); + } + }else { // in all other cases, simple retry tscProcessSql(pSql); }