handle fixed table name int sql
This commit is contained in:
parent
3151d0663c
commit
b8012df909
|
@ -1015,6 +1015,12 @@ int stmtSetTbTags(TAOS_STMT* stmt, TAOS_MULTI_BIND* tags) {
|
||||||
|
|
||||||
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_SETTAGS));
|
STMT_ERR_RET(stmtSwitchStatus(pStmt, STMT_SETTAGS));
|
||||||
|
|
||||||
|
SBoundColInfo *tags_info = (SBoundColInfo*)pStmt->bInfo.boundTags;
|
||||||
|
if (tags_info->numOfBound <= 0 || tags_info->numOfCols <= 0) {
|
||||||
|
tscWarn("no tags bound in sql, will not bound tags");
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
if (pStmt->bInfo.inExecCache) {
|
if (pStmt->bInfo.inExecCache) {
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2444,6 +2444,13 @@ static int32_t checkTableClauseFirstToken(SInsertParseContext* pCxt, SVnodeModif
|
||||||
pTbName->n = strlen(tbName);
|
pTbName->n = strlen(tbName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pCxt->isStmtBind) {
|
||||||
|
if (TK_NK_ID == pTbName->type || (tbNameAfterDbName != NULL && *(tbNameAfterDbName + 1) != '?')) {
|
||||||
|
// In SQL statements, the table name has already been specified.
|
||||||
|
parserWarn("0x%" PRIx64 " table name is specified in sql, ignore the table name in bind param", pCxt->pComCxt->requestId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*pHasData = true;
|
*pHasData = true;
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue