fix: ut issue

This commit is contained in:
dapan1121 2024-04-30 09:42:53 +08:00
parent 6ffa3945ea
commit 0ef476a09e
1 changed files with 6 additions and 2 deletions

View File

@ -1054,9 +1054,9 @@ static bool isPrimaryKey(STempTableNode* pTable, SNode* pExpr) {
static bool hasPkInTable(const STableMeta* pTableMeta) {
bool hasPK = pTableMeta->tableInfo.numOfColumns >= 2 && pTableMeta->schema[1].flags & COL_IS_KEY;
if (hasPK) {
uInfo("has primary key, %s", pTableMeta->schema[1].name);
uDebug("has primary key, %s", pTableMeta->schema[1].name);
} else {
uInfo("no primary key, %s", pTableMeta->schema[1].name);
uDebug("no primary key, %s", pTableMeta->schema[1].name);
}
return hasPK;
}
@ -9327,6 +9327,10 @@ static int32_t addSubtableNameToCreateStreamQuery(STranslateContext* pCxt, SCrea
if (NULL == pStmt->pSubtable) {
return TSDB_CODE_SUCCESS;
}
pSelect->pSubtable = nodesCloneNode(pStmt->pSubtable);
if (NULL == pSelect->pSubtable) {
return TSDB_CODE_OUT_OF_MEMORY;
}
SRewriteSubtableCxt cxt = {.pCxt = pCxt, .pPartitionList = pSelect->pPartitionByList};
nodesRewriteExpr(&pSelect->pSubtable, rewriteSubtable, &cxt);