Fix(stmt): skip stmt while use ctg cache.
This commit is contained in:
parent
be9732d774
commit
69e88f9f5c
|
@ -1367,6 +1367,7 @@ int32_t ctgGetTbMetaFromMnode(SCatalog* pCtg, SRequestConnInfo* pConn, const SNa
|
|||
int32_t ctgGetTbMetaFromVnode(SCatalog* pCtg, SRequestConnInfo* pConn, const SName* pTableName, SVgroupInfo* vgroupInfo,
|
||||
STableMetaOutput* out, SCtgTaskReq* tReq) {
|
||||
SCtgTask* pTask = tReq ? tReq->pTask : NULL;
|
||||
uint8_t autoCreateCtb = tReq ? tReq->autoCreateCtb : 0;
|
||||
char dbFName[TSDB_DB_FNAME_LEN];
|
||||
(void)tNameGetFullDbName(pTableName, dbFName);
|
||||
int32_t reqType = (pTask && pTask->type == CTG_TASK_GET_TB_NAME ? TDMT_VND_TABLE_NAME : TDMT_VND_TABLE_META);
|
||||
|
@ -1380,7 +1381,7 @@ int32_t ctgGetTbMetaFromVnode(SCatalog* pCtg, SRequestConnInfo* pConn, const SNa
|
|||
|
||||
SBuildTableInput bInput = {.vgId = vgroupInfo->vgId,
|
||||
.option = reqType == TDMT_VND_TABLE_NAME ? REQ_OPT_TBUID : REQ_OPT_TBNAME,
|
||||
.autoCreateCtb = tReq->autoCreateCtb,
|
||||
.autoCreateCtb = autoCreateCtb,
|
||||
.dbFName = dbFName,
|
||||
.tbName = (char*)tNameGetTableName(pTableName)};
|
||||
char* msg = NULL;
|
||||
|
|
|
@ -1328,6 +1328,9 @@ static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifyOpStmt
|
|||
bool bUsingTable = true;
|
||||
code = getTableMeta(pCxt, &pStmt->usingTableName, &pStableMeta, &pCxt->missCache, bUsingTable);
|
||||
}
|
||||
if (pCxt->isStmtBind) {
|
||||
goto _no_ctb_cache;
|
||||
}
|
||||
|
||||
if (TSDB_CODE_SUCCESS == code && !pCxt->missCache) {
|
||||
bool bUsingTable = false;
|
||||
|
@ -1338,11 +1341,12 @@ static int32_t getUsingTableSchema(SInsertParseContext* pCxt, SVnodeModifyOpStmt
|
|||
code = (pStableMeta->suid == pCtableMeta->suid) ? TSDB_CODE_SUCCESS : TSDB_CODE_TDB_TABLE_IN_OTHER_STABLE;
|
||||
*ctbCacheHit = true;
|
||||
}
|
||||
_no_ctb_cache:
|
||||
if (TSDB_CODE_SUCCESS == code) {
|
||||
if (*ctbCacheHit) {
|
||||
code = cloneTableMeta(pCtableMeta,&pStmt->pTableMeta);
|
||||
code = cloneTableMeta(pCtableMeta, &pStmt->pTableMeta);
|
||||
} else {
|
||||
code = cloneTableMeta( pStableMeta,&pStmt->pTableMeta);
|
||||
code = cloneTableMeta(pStableMeta, &pStmt->pTableMeta);
|
||||
}
|
||||
}
|
||||
taosMemoryFree(pStableMeta);
|
||||
|
|
Loading…
Reference in New Issue