1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-12 23:22:53 +03:00

Further tests and assert() statements for the change on this branch.

FossilOrigin-Name: 1c202d540ac362bfc747a9f8472e83c9d7614e38467f8b48787a669fb34664ba
This commit is contained in:
dan
2023-09-16 14:42:18 +00:00
parent 63702bccaa
commit 2e8edc1d45
4 changed files with 49 additions and 15 deletions

View File

@@ -282,7 +282,7 @@ static int lookupName(
){
int i, j; /* Loop counters */
int cnt = 0; /* Number of matching column names */
int cntTab = 0; /* Number of matching table names */
int cntTab = 0; /* Number of potential "rowid" matches */
int nSubquery = 0; /* How many levels of subquery */
sqlite3 *db = pParse->db; /* The database connection */
SrcItem *pItem; /* Use for looping over pSrcList items */
@@ -391,12 +391,17 @@ static int lookupName(
cnt++;
hit = 1;
}else if( cnt>0 ){
/* This is a potential rowid match, but there has already been
** a real match found. So this can be ignored. */
continue;
}
cntTab++;
pMatch = pItem;
pExpr->iColumn = j;
pEList->a[j].fg.bUsed = 1;
/* rowid cannot be part of a USING clause - assert() this. */
assert( bRowid==0 || pEList->a[j].fg.bUsingTerm==0 );
if( pEList->a[j].fg.bUsingTerm ) break;
}
if( hit || zTab==0 ) continue;