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

The ALTER TABLE command should not attempt to rename objects that are

contained within an expression tree that has been optimized out because
it is the other branch of an "AND false" expression.
Ticket [533010b8cacebe82]

FossilOrigin-Name: 04bd5cb73287f926f1ecf578998fa6ce1379474e86918c692eae5778d0817cef
This commit is contained in:
drh
2019-06-11 02:43:22 +00:00
parent a753d40039
commit b854b76733
4 changed files with 27 additions and 11 deletions

View File

@@ -894,9 +894,11 @@ Expr *sqlite3ExprAnd(Parse *pParse, Expr *pLeft, Expr *pRight){
return pRight;
}else if( pRight==0 ){
return pLeft;
}else if( pParse->nErr || IN_RENAME_OBJECT ){
return sqlite3PExpr(pParse, TK_AND, pLeft, pRight);
}else if( ExprAlwaysFalse(pLeft) || ExprAlwaysFalse(pRight) ){
if( IN_RENAME_OBJECT ){
sqlite3RenameExprUnmap(pParse, pLeft);
sqlite3RenameExprUnmap(pParse, pRight);
}
sqlite3ExprDelete(db, pLeft);
sqlite3ExprDelete(db, pRight);
return sqlite3ExprAlloc(db, TK_INTEGER, &sqlite3IntTokens[0], 0);