mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
Merge the ALTER TABLE fix from trunk.
FossilOrigin-Name: d5ceaef3fca8cb4791ead9cbfe00d0eafa1bdc2b0522c3599c68b40fe6a7efe2
This commit is contained in:
13
src/select.c
13
src/select.c
@@ -5834,13 +5834,19 @@ static int selectExpander(Walker *pWalker, Select *p){
|
||||
zColname = zName;
|
||||
zToFree = 0;
|
||||
}
|
||||
if( pTabList->nSrc>1
|
||||
&& ( (pFrom->fg.jointype & JT_LTORJ)==0
|
||||
|| !inAnyUsingClause(zName,pFrom,pTabList->nSrc-i-1) )
|
||||
if( (pTabList->nSrc>1
|
||||
&& ( (pFrom->fg.jointype & JT_LTORJ)==0
|
||||
|| !inAnyUsingClause(zName,pFrom,pTabList->nSrc-i-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);
|
||||
@@ -5849,6 +5855,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