aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <>2022-04-10 23:48:47 +0000
committerdrh <>2022-04-10 23:48:47 +0000
commit529394e5c1399577be9a882b2f8be11fa1966cf5 (patch)
tree34b3f08195bf8ebe9d385882dee8e83226fd25be /src
parent9debb58e4801ad5737ff88fbc117a1fc06695efa (diff)
downloadsqlite-529394e5c1399577be9a882b2f8be11fa1966cf5.tar.gz
sqlite-529394e5c1399577be9a882b2f8be11fa1966cf5.zip
Cannot use an automatic index on the right table of a RIGHT JOIN because
automatic indexes must be WHERE_IDX_ONLY, but the RIGHT JOIN post-processing does not know how to work with an index-only scan. FossilOrigin-Name: beb4401dc09fb68e85ddcf3f99598527691535d0eb7693168f440e5a5a076e3f
Diffstat (limited to 'src')
-rw-r--r--src/where.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/where.c b/src/where.c
index 56c3a0171..adae72a4f 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3324,6 +3324,7 @@ static int whereLoopAddBtree(
&& HasRowid(pTab) /* Not WITHOUT ROWID table. (FIXME: Why not?) */
&& !pSrc->fg.isCorrelated /* Not a correlated subquery */
&& !pSrc->fg.isRecursive /* Not a recursive common table expression. */
+ && (pSrc->fg.jointype & JT_RIGHT)==0 /* Not the right tab of a RIGHT JOIN */
){
/* Generate auto-index WhereLoops */
LogEst rLogSize; /* Logarithm of the number of rows in the table */