enh: improve error reporting information

This commit is contained in:
Xiaoyu Wang 2023-03-23 14:15:49 +08:00
parent fddf3f16cf
commit e15e40abdf
1 changed files with 5 additions and 0 deletions

View File

@ -1492,6 +1492,7 @@ static void resetEnvPreTable(SInsertParseContext* pCxt, SVnodeModifyOpStmt* pStm
pStmt->pBoundCols = NULL; pStmt->pBoundCols = NULL;
pStmt->usingTableProcessing = false; pStmt->usingTableProcessing = false;
pStmt->fileProcessing = false; pStmt->fileProcessing = false;
pStmt->usingTableName.type = 0;
} }
// input pStmt->pSql: [(field1_name, ...)] [ USING ... ] VALUES ... | FILE ... // input pStmt->pSql: [(field1_name, ...)] [ USING ... ] VALUES ... | FILE ...
@ -1539,6 +1540,10 @@ static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModif
} }
} }
if (TK_NK_ID != pTbName->type && TK_NK_STRING != pTbName->type) {
return buildSyntaxErrMsg(&pCxt->msg, "table_name is expected", pTbName->z);
}
*pHasData = true; *pHasData = true;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }