aboutsummaryrefslogtreecommitdiff
path: root/src/where.c
diff options
context:
space:
mode:
authordrh <>2025-04-15 21:59:38 +0000
committerdrh <>2025-04-15 21:59:38 +0000
commit0243ca82459db9984f3708eb844b32bcebbff2e5 (patch)
tree86a361a59af7b29db2b4b7a3b870e99521e48b8b /src/where.c
parent8488789d742ba6cb818fab54d3c34e3d512413a0 (diff)
downloadsqlite-0243ca82459db9984f3708eb844b32bcebbff2e5.tar.gz
sqlite-0243ca82459db9984f3708eb844b32bcebbff2e5.zip
Correctly handle the case of a multi-column UNIQUE constraint that contains
the ROWID as one of it columns, and then the columns of that UNIQUE are used in a row-value IN operator as a WHERE clause constraint. Reported by [forum:/forumpost/b9647a113b465950|forum post b9647a113b]. Problem introduced by [723f1be3d4a905a6], part of ticket [da78413751863]. FossilOrigin-Name: d22475b81c4e26ccc50f3b5626d43b32f7a2de34e5a764539554665bdda735d5
Diffstat (limited to 'src/where.c')
-rw-r--r--src/where.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 3320f6855..c51d1ba81 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3476,7 +3476,7 @@ static int whereLoopAddBtreeIndex(
if( (pNew->wsFlags & WHERE_TOP_LIMIT)==0
&& pNew->u.btree.nEq<pProbe->nColumn
&& (pNew->u.btree.nEq<pProbe->nKeyCol ||
- pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY)
+ (pProbe->idxType!=SQLITE_IDXTYPE_PRIMARYKEY && !pProbe->bIdxRowid))
){
if( pNew->u.btree.nEq>3 ){
sqlite3ProgressCheck(pParse);