diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index d3cbaac5e1bde5437c9c36b61e9032391fd217ca..afb5ce6c9a9583a96ae12897b5bb03f6ee9e43c8 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -399,6 +399,7 @@ static int32_t logicScanCopy(const SScanLogicNode* pSrc, SScanLogicNode* pDst) { CLONE_NODE_FIELD(pSubtable); COPY_SCALAR_FIELD(igLastNull); COPY_SCALAR_FIELD(groupOrderScan); + COPY_SCALAR_FIELD(onlyMetaCtbIdx); return TSDB_CODE_SUCCESS; } diff --git a/source/libs/parser/src/parAstCreater.c b/source/libs/parser/src/parAstCreater.c index ef0653198fb2c5ee703da72ef35aad5f690a1cb0..b897faebdf0e2dc6e76f4a57dd72a764f270f4b9 100644 --- a/source/libs/parser/src/parAstCreater.c +++ b/source/libs/parser/src/parAstCreater.c @@ -853,7 +853,7 @@ SNode* createSelectStmt(SAstCreateContext* pCxt, bool isDistinct, SNodeList* pPr } SNode* setSelectStmtTagMode(SAstCreateContext* pCxt, SNode* pStmt, bool bSelectTags) { - if (QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { + if (pStmt && QUERY_NODE_SELECT_STMT == nodeType(pStmt)) { ((SSelectStmt*)pStmt)->tagScan = bSelectTags; } return pStmt; diff --git a/source/libs/planner/src/planLogicCreater.c b/source/libs/planner/src/planLogicCreater.c index 3c02675bc71f68d828d1a2770b1d0ee792aa4e19..a822c7f9fe1ffe37066a0c1ca0c82d01849e254c 100644 --- a/source/libs/planner/src/planLogicCreater.c +++ b/source/libs/planner/src/planLogicCreater.c @@ -345,11 +345,10 @@ static int32_t makeScanLogicNode(SLogicPlanContext* pCxt, SRealTableNode* pRealT static bool needScanDefaultCol(EScanType scanType) { return SCAN_TYPE_TABLE_COUNT != scanType; } static EDealRes tagScanNodeHasTbnameFunc(SNode* pNode, void* pContext) { - if (QUERY_NODE_COLUMN == nodeType(pNode)) { - if (COLUMN_TYPE_TBNAME == ((SColumnNode*)pNode)->colType) { - *(bool*)pContext = true; - return DEAL_RES_END; - } + if (QUERY_NODE_FUNCTION == nodeType(pNode) && FUNCTION_TYPE_TBNAME == ((SFunctionNode*)pNode)->funcType || + (QUERY_NODE_COLUMN == nodeType(pNode) && COLUMN_TYPE_TBNAME == ((SColumnNode*)pNode)->colType)) { + *(bool*)pContext = true; + return DEAL_RES_END; } return DEAL_RES_CONTINUE; }