diff --git a/src/client/src/tscAsync.c b/src/client/src/tscAsync.c index 602b8cc430d915d133fd0761185b1671d6a17dd0..23071fccfacf5c9f0de680555a4fd944e6106f0b 100644 --- a/src/client/src/tscAsync.c +++ b/src/client/src/tscAsync.c @@ -451,7 +451,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { STableMetaInfo* pTableMetaInfo = tscGetMetaInfo(pQueryInfo, 0); if (pTableMetaInfo->pTableMeta == NULL){ code = tscGetTableMeta(pSql, pTableMetaInfo); - assert(code == TSDB_CODE_SUCCESS); + if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { + return; + } else { + assert(code == TSDB_CODE_SUCCESS); + } } assert((tscGetNumOfTags(pTableMetaInfo->pTableMeta) != 0) && pTableMetaInfo->vgroupIndex >= 0 && pSql->param != NULL); @@ -473,7 +477,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0); code = tscGetTableMeta(pSql, pTableMetaInfo); - assert(code == TSDB_CODE_SUCCESS); + if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { + return; + } else { + assert(code == TSDB_CODE_SUCCESS); + } // if failed to process sql, go to error handler if ((code = tscProcessSql(pSql)) == TSDB_CODE_SUCCESS) { @@ -483,7 +491,6 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { // // 1. table uid, 2. ip address // code = tscSendMsgToServer(pSql); // if (code == TSDB_CODE_SUCCESS) return; -// } } else { tscTrace("%p continue parse sql after get table meta", pSql); @@ -491,8 +498,11 @@ void tscTableMetaCallBack(void *param, TAOS_RES *res, int code) { if (TSDB_QUERY_HAS_TYPE(pQueryInfo->type, TSDB_QUERY_TYPE_STMT_INSERT)) { STableMetaInfo* pTableMetaInfo = tscGetTableMetaInfoFromCmd(pCmd, pCmd->clauseIndex, 0); code = tscGetTableMeta(pSql, pTableMetaInfo); - assert(code == TSDB_CODE_SUCCESS && pTableMetaInfo->pTableMeta != NULL); - + if (code == TSDB_CODE_TSC_ACTION_IN_PROGRESS) { + return; + } else { + assert(code == TSDB_CODE_SUCCESS); + } (*pSql->fp)(pSql->param, pSql, code); return; } diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 372e81d7371debe904ac7ad1e6a9caecb54ccb28..5db50b3936f430c707d0f77db8e6f4542b0c7eb7 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -543,7 +543,7 @@ int32_t tscToSQLCmd(SSqlObj* pSql, struct SSqlInfo* pInfo) { return invalidSqlErrMsg(tscGetErrorMsgPayload(pCmd), "not support sql expression"); } - pSql->cmd.parseFinished = true; + pSql->cmd.parseFinished = 1; return tscBuildMsg[pCmd->command](pSql, pInfo); } diff --git a/src/client/src/tscUtil.c b/src/client/src/tscUtil.c index 2701d2b572d9f893b265c6cc1262ee08d4bbaf6f..215b544639de0758ad02bfcd6d9faebe41b1912e 100644 --- a/src/client/src/tscUtil.c +++ b/src/client/src/tscUtil.c @@ -396,12 +396,14 @@ void tscPartiallyFreeSqlObj(SSqlObj* pSql) { if (pObj->signature == pObj) { pthread_mutex_lock(&pObj->mutex); tfree(pSql->sqlstr); + pSql->sqlstr = NULL; pthread_mutex_unlock(&pObj->mutex); } tscFreeSqlResult(pSql); tfree(pSql->pSubs); + pSql->pSubs = NULL; pSql->freed = 0; pSql->numOfSubs = 0;