1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Do not duplicate the Expr.pLeft subtree of a TK_SELECT_COLUMN node.

FossilOrigin-Name: 8384c77ebb3f65fbc54c199885926f2066f0b140
This commit is contained in:
drh
2016-08-20 17:00:16 +00:00
parent f358009a93
commit 9854260bca
3 changed files with 13 additions and 9 deletions

View File

@@ -1205,7 +1205,11 @@ static Expr *exprDup(sqlite3 *db, Expr *p, int dupFlags, u8 **pzBuffer){
}
}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);
}
}