未验证 提交 e7baca36 编写于 作者: weixin_48148422's avatar weixin_48148422 提交者: GitHub

Merge pull request #1026 from taosdata/feature/lihui

[TBASE-1360]
...@@ -952,6 +952,9 @@ int doParserInsertSql(SSqlObj *pSql, char *str) { ...@@ -952,6 +952,9 @@ int doParserInsertSql(SSqlObj *pSql, char *str) {
return code; return code;
} }
ASSERT(((NULL == pSql->asyncTblPos) && (NULL == pSql->pTableHashList))
|| ((NULL != pSql->asyncTblPos) && (NULL != pSql->pTableHashList)));
if ((NULL == pSql->asyncTblPos) && (NULL == pSql->pTableHashList)) { if ((NULL == pSql->asyncTblPos) && (NULL == pSql->pTableHashList)) {
pSql->pTableHashList = taosInitIntHash(128, POINTER_BYTES, taosHashInt); pSql->pTableHashList = taosInitIntHash(128, POINTER_BYTES, taosHashInt);
pSql->cmd.pDataBlocks = tscCreateBlockArrayList(); pSql->cmd.pDataBlocks = tscCreateBlockArrayList();
...@@ -960,6 +963,7 @@ int doParserInsertSql(SSqlObj *pSql, char *str) { ...@@ -960,6 +963,7 @@ int doParserInsertSql(SSqlObj *pSql, char *str) {
goto _error_clean; goto _error_clean;
} }
} else { } else {
ASSERT((NULL != pSql->asyncTblPos) && (NULL != pSql->pTableHashList));
str = pSql->asyncTblPos; str = pSql->asyncTblPos;
} }
...@@ -997,8 +1001,13 @@ int doParserInsertSql(SSqlObj *pSql, char *str) { ...@@ -997,8 +1001,13 @@ int doParserInsertSql(SSqlObj *pSql, char *str) {
void *fp = pSql->fp; void *fp = pSql->fp;
if ((code = tscParseSqlForCreateTableOnDemand(&str, pSql)) != TSDB_CODE_SUCCESS) { if ((code = tscParseSqlForCreateTableOnDemand(&str, pSql)) != TSDB_CODE_SUCCESS) {
if (fp != NULL) { if (fp != NULL) {
//goto _clean; if (TSDB_CODE_ACTION_IN_PROGRESS == code) {
return code; tscTrace("async insert and waiting to get meter meta, then continue parse sql: %s", pSql->asyncTblPos);
return code;
}
tscTrace("async insert parse error, code:%d, %s", code, tsError[code]);
pSql->asyncTblPos = NULL;
goto _error_clean; // TODO: should _clean or _error_clean to async flow ????
} else { } else {
/* /*
* for async insert, the free data block operations, which is tscDestroyBlockArrayList, * for async insert, the free data block operations, which is tscDestroyBlockArrayList,
...@@ -1239,9 +1248,11 @@ int tsParseSql(SSqlObj *pSql, char *acct, char *db, bool multiVnodeInsertion) { ...@@ -1239,9 +1248,11 @@ int tsParseSql(SSqlObj *pSql, char *acct, char *db, bool multiVnodeInsertion) {
tscRemoveAllMeterMetaInfo(&pSql->cmd, false); tscRemoveAllMeterMetaInfo(&pSql->cmd, false);
if (NULL == pSql->asyncTblPos) { if (NULL == pSql->asyncTblPos) {
tscTrace("continue parse sql: %s", pSql->asyncTblPos);
tscCleanSqlCmd(&pSql->cmd); tscCleanSqlCmd(&pSql->cmd);
} else {
tscTrace("continue parse sql: %s", pSql->asyncTblPos);
} }
if (tscIsInsertOrImportData(pSql->sqlstr)) { if (tscIsInsertOrImportData(pSql->sqlstr)) {
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册