1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-05 04:30:38 +03:00

Make sure "rowid" columns are correctly resolved in joins between normal

tables and WITHOUT ROWID tables.  Fix for ticket [c34d0557f740c45070].

FossilOrigin-Name: 5d01426ddfb2d47c57f93f71378594e637424be0
This commit is contained in:
drh
2014-02-12 14:43:52 +00:00
parent c5185cd845
commit 784156f84c
4 changed files with 25 additions and 11 deletions

View File

@@ -380,8 +380,8 @@ static int lookupName(
/*
** Perhaps the name is a reference to the ROWID
*/
assert( pTab!=0 || cntTab==0 );
if( cnt==0 && cntTab==1 && sqlite3IsRowid(zCol) && HasRowid(pTab) ){
if( cnt==0 && cntTab==1 && pMatch && sqlite3IsRowid(zCol)
&& HasRowid(pMatch->pTab) ){
cnt = 1;
pExpr->iColumn = -1; /* IMP: R-44911-55124 */
pExpr->affinity = SQLITE_AFF_INTEGER;