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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user