mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Fix a problem in ALTER TABLE with handling "table.*" expressions within SELECT statements in triggers.
FossilOrigin-Name: 24755fd0657252e49793bb1fe906973a2dd84a1bde03bea9a762de36cc96c2d2
This commit is contained in:
@@ -5755,10 +5755,13 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
pRight = sqlite3Expr(db, TK_ID, zName);
|
||||
zColname = zName;
|
||||
zToFree = 0;
|
||||
if( longNames || pTabList->nSrc>1 ){
|
||||
if( longNames || pTabList->nSrc>1 || IN_RENAME_OBJECT ){
|
||||
Expr *pLeft;
|
||||
pLeft = sqlite3Expr(db, TK_ID, zTabName);
|
||||
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pRight);
|
||||
if( IN_RENAME_OBJECT && pE->pLeft ){
|
||||
sqlite3RenameTokenRemap(pParse, pLeft, pE->pLeft);
|
||||
}
|
||||
if( zSchemaName ){
|
||||
pLeft = sqlite3Expr(db, TK_ID, zSchemaName);
|
||||
pExpr = sqlite3PExpr(pParse, TK_DOT, pLeft, pExpr);
|
||||
@@ -5771,6 +5774,7 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
pExpr = pRight;
|
||||
}
|
||||
pNew = sqlite3ExprListAppend(pParse, pNew, pExpr);
|
||||
|
||||
sqlite3TokenInit(&sColname, zColname);
|
||||
sqlite3ExprListSetName(pParse, pNew, &sColname, 0);
|
||||
if( pNew && (p->selFlags & SF_NestedFrom)!=0 && !IN_RENAME_OBJECT ){
|
||||
|
||||
Reference in New Issue
Block a user