aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <Dan Kennedy>2023-09-16 14:42:18 +0000
committerdan <Dan Kennedy>2023-09-16 14:42:18 +0000
commit2e8edc1d45d9b7b64cc2fa0539c5b9931c8603d2 (patch)
tree8afa52e9e6416d175e4dda95ca511ad601b4444b /src
parent63702bccaaf87a1af36fc714cc496645348bf406 (diff)
downloadsqlite-2e8edc1d45d9b7b64cc2fa0539c5b9931c8603d2.tar.gz
sqlite-2e8edc1d45d9b7b64cc2fa0539c5b9931c8603d2.zip
Further tests and assert() statements for the change on this branch.
FossilOrigin-Name: 1c202d540ac362bfc747a9f8472e83c9d7614e38467f8b48787a669fb34664ba
Diffstat (limited to 'src')
-rw-r--r--src/resolve.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/resolve.c b/src/resolve.c
index 6935480ce..d84329034 100644
--- a/src/resolve.c
+++ b/src/resolve.c
@@ -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;