mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-11 01:42:22 +03:00
When converting a NATURAL JOIN into a JOIN USING, make sure to insert the
name correctly into the IdList even if it is a wierd quoted name. FossilOrigin-Name: e62156b696f2496e2697cb3b46f136551b58644e2a5824aa3d759596694b2f4b
This commit is contained in:
10
src/select.c
10
src/select.c
@@ -483,10 +483,12 @@ static int sqlite3ProcessJoin(Parse *pParse, Select *p){
|
||||
if( IsHiddenColumn(&pRightTab->aCol[j]) ) continue;
|
||||
zName = pRightTab->aCol[j].zCnName;
|
||||
if( tableAndColumnIndex(pSrc, 0, i, zName, 0, 0, 1) ){
|
||||
Token x;
|
||||
x.z = zName;
|
||||
x.n = sqlite3Strlen30(zName);
|
||||
pUsing = sqlite3IdListAppend(pParse, pUsing, &x);
|
||||
pUsing = sqlite3IdListAppend(pParse, pUsing, 0);
|
||||
if( pUsing ){
|
||||
assert( pUsing->nId>0 );
|
||||
assert( pUsing->a[pUsing->nId-1].zName==0 );
|
||||
pUsing->a[pUsing->nId-1].zName = sqlite3DbStrDup(pParse->db, zName);
|
||||
}
|
||||
}
|
||||
}
|
||||
if( pUsing ){
|
||||
|
||||
Reference in New Issue
Block a user