diff options
author | drh <> | 2024-05-18 20:00:08 +0000 |
---|---|---|
committer | drh <> | 2024-05-18 20:00:08 +0000 |
commit | 04624990514ae7c593ad224dd87cd9037cec752f (patch) | |
tree | 88e3ed5bd9703df77b9193cf3594eb557d049a70 /src/resolve.c | |
parent | 79dac84b315ced19266d55f769341782f429e6b4 (diff) | |
download | sqlite-04624990514ae7c593ad224dd87cd9037cec752f.tar.gz sqlite-04624990514ae7c593ad224dd87cd9037cec752f.zip |
Fix the definition of sqlite3_vtab_distinct() such that return codes 2 and
3 mean that all rows must be distinct over "colUsed" which is a superset of
"aOrderBy". Also, disallow return codes 2 and 3 if the rowid of the virtual
table is accessed.
FossilOrigin-Name: 922731ce98c0ce7837784ff7966049e59fa73da2aa04abf3506503b6fc4aa048
Diffstat (limited to 'src/resolve.c')
-rw-r--r-- | src/resolve.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/resolve.c b/src/resolve.c index 546731afe..bf8326aa6 100644 --- a/src/resolve.c +++ b/src/resolve.c @@ -828,8 +828,12 @@ static int lookupName( ** If a generated column is referenced, set bits for every column ** of the table. */ - if( pExpr->iColumn>=0 && cnt==1 && pMatch!=0 ){ - pMatch->colUsed |= sqlite3ExprColUsed(pExpr); + if( pMatch ){ + if( pExpr->iColumn>=0 ){ + pMatch->colUsed |= sqlite3ExprColUsed(pExpr); + }else{ + pMatch->fg.rowidUsed = 1; + } } pExpr->op = eNewExprOp; |