Do not duplicate the Expr.pLeft subtree of a TK_SELECT_COLUMN node.
FossilOrigin-Name: 8384c77ebb3f65fbc54c199885926f2066f0b140
diff --git a/src/expr.c b/src/expr.c
index 0412919..bd2426a 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -1205,7 +1205,11 @@
}
}else{
if( !ExprHasProperty(p, EP_TokenOnly) ){
- pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
+ if( pNew->op==TK_SELECT_COLUMN ){
+ pNew->pLeft = p->pLeft;
+ }else{
+ pNew->pLeft = sqlite3ExprDup(db, p->pLeft, 0);
+ }
pNew->pRight = sqlite3ExprDup(db, p->pRight, 0);
}
}