提交 683cf876 编写于 作者: S shenglian zhou

fix: set parent of new logic node to null

上级 a2150031
...@@ -107,6 +107,7 @@ int32_t createColumnByRewriteExpr(SNode* pExpr, SNodeList** pList) { ...@@ -107,6 +107,7 @@ int32_t createColumnByRewriteExpr(SNode* pExpr, SNodeList** pList) {
int32_t replaceLogicNode(SLogicSubplan* pSubplan, SLogicNode* pOld, SLogicNode* pNew) { int32_t replaceLogicNode(SLogicSubplan* pSubplan, SLogicNode* pOld, SLogicNode* pNew) {
if (NULL == pOld->pParent) { if (NULL == pOld->pParent) {
pSubplan->pNode = (SLogicNode*)pNew; pSubplan->pNode = (SLogicNode*)pNew;
pNew->pParent = NULL;
return TSDB_CODE_SUCCESS; return TSDB_CODE_SUCCESS;
} }
......
...@@ -57,4 +57,6 @@ TEST_F(PlanOptimizeTest, eliminateProjection) { ...@@ -57,4 +57,6 @@ TEST_F(PlanOptimizeTest, eliminateProjection) {
useDb("root", "test"); useDb("root", "test");
run("SELECT c1, sum(c3) FROM t1 GROUP BY c1"); run("SELECT c1, sum(c3) FROM t1 GROUP BY c1");
run("SELECT c1 FROM t1");
run("SELECT * FROM st1");
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册