From 3ed44d75b9c532711d0204af52aa20bef0299de1 Mon Sep 17 00:00:00 2001 From: dapan1121 Date: Wed, 24 Apr 2024 19:14:20 +0800 Subject: [PATCH] fix: window join in view issue --- include/libs/nodes/querynodes.h | 1 - source/libs/nodes/src/nodesCloneFuncs.c | 3 +++ source/libs/parser/src/parTranslater.c | 1 - 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/include/libs/nodes/querynodes.h b/include/libs/nodes/querynodes.h index 44332d8b51..5b889171b3 100644 --- a/include/libs/nodes/querynodes.h +++ b/include/libs/nodes/querynodes.h @@ -270,7 +270,6 @@ typedef struct SJoinTableNode { SNode* addPrimCond; bool hasSubQuery; bool isLowLevelJoin; - SNode* pParent; SNode* pLeft; SNode* pRight; SNode* pOnCond; diff --git a/source/libs/nodes/src/nodesCloneFuncs.c b/source/libs/nodes/src/nodesCloneFuncs.c index 5f59fabec5..1a51620856 100644 --- a/source/libs/nodes/src/nodesCloneFuncs.c +++ b/source/libs/nodes/src/nodesCloneFuncs.c @@ -300,6 +300,9 @@ static int32_t joinTableNodeCopy(const SJoinTableNode* pSrc, SJoinTableNode* pDs COPY_BASE_OBJECT_FIELD(table, tableNodeCopy); COPY_SCALAR_FIELD(joinType); COPY_SCALAR_FIELD(subType); + CLONE_NODE_FIELD(pWindowOffset); + CLONE_NODE_FIELD(pJLimit); + CLONE_NODE_FIELD(addPrimCond); COPY_SCALAR_FIELD(hasSubQuery); COPY_SCALAR_FIELD(isLowLevelJoin); CLONE_NODE_FIELD(pLeft); diff --git a/source/libs/parser/src/parTranslater.c b/source/libs/parser/src/parTranslater.c index 60c7b30a47..8f77f0dedf 100644 --- a/source/libs/parser/src/parTranslater.c +++ b/source/libs/parser/src/parTranslater.c @@ -4394,7 +4394,6 @@ int32_t translateTable(STranslateContext* pCxt, SNode** pTable, SNode* pJoinPare } case QUERY_NODE_JOIN_TABLE: { SJoinTableNode* pJoinTable = (SJoinTableNode*)*pTable; - pJoinTable->pParent = pJoinParent; code = translateJoinTable(pCxt, pJoinTable); if (TSDB_CODE_SUCCESS == code) { code = translateTable(pCxt, &pJoinTable->pLeft, (SNode*)pJoinTable);