]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Disable the vector-IN-SELECT optimization if the number of columns is so master
authordrh <>
Thu, 4 Jun 2026 16:56:11 +0000 (16:56 +0000)
committerdrh <>
Thu, 4 Jun 2026 16:56:11 +0000 (16:56 +0000)
large that it would cause the WhereTerm.nChild column to wrap.
[bugs:/info/2026-06-04T10:00:49Z|Bug 2026-06-04T10:00:49Z].

FossilOrigin-Name: bb49dfc948048779a30deff9a3d1bb39846f6f72c26a2bdcdd0e386251720fe6

manifest
manifest.uuid
src/whereexpr.c

index 8734bd14fa39529807eb9ae88d0d2b9fcc79d13a..836a7ba8c74a12499858a52f8b204a51a209fbb5 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\scrash\sthat\scould\sbe\scaused\sby\sconfiguring\sthe\spager-cache\swith\sa\sbulk\sallocation\stoo\ssmall\sto\sfit\seven\sone\spage.\sBug\s[bugs:/info/2026-06-04T07:03:12Z\s|\s2026-06-04T07:03:12Z].
-D 2026-06-04T11:48:18.682
+C Disable\sthe\svector-IN-SELECT\soptimization\sif\sthe\snumber\sof\scolumns\sis\sso\nlarge\sthat\sit\swould\scause\sthe\sWhereTerm.nChild\scolumn\sto\swrap.\n[bugs:/info/2026-06-04T10:00:49Z|Bug\s2026-06-04T10:00:49Z].
+D 2026-06-04T16:56:11.519
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -822,7 +822,7 @@ F src/walker.c d5006d6b005e4ea7302ad390957a8d41ed83faa177e412f89bc5600a7462a014
 F src/where.c 33e4a6558ee69f33d6a4e7069e3a40a55959d14e5653a9a83926e70305d471f3
 F src/whereInt.h 8d94cb116c9e06205c3d5ac87af065fc044f8cf08bfdccd94b6ea1c1308e65da
 F src/wherecode.c bc39ccbe3648f01157038b16cc55bdbff128590972b7185521b5526dc2815765
-F src/whereexpr.c 61b1c9d98d39f6bcd79fcb4ebb4c9478effb259fefac4c7d3e78e4957f97f75a
+F src/whereexpr.c a1e22cf9f6cb59770d9652c757dcf1924078ad2d48a9da89e254be9327677465
 F src/window.c c0a38cd32473e8e8e7bc435039f914a36ca42465506dc491c65870c01ddac9fb
 F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
 F test/affinity2.test 4d7a34d328e58ca2a2d78fd76c27614a41ca7ddf4312ded9c68c04f430b3b47d
@@ -2208,8 +2208,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
 F tool/warnings.sh a554d13f6e5cf3760f041b87939e3d616ec6961859c3245e8ef701d1eafc2ca2
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
 F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P fa6374fe3ae1530f0b5ba10b7e6fb703ffe5dd592c532a965e7d50b7d2d70a5f
-R 6de34bc043d0c829fd93ff6edfd1a32a
-U dan
-Z 14bc5457646dbc84d7522f7a51ce7645
+P b4b9dc632b06f932759bc2fceeb6fa1dd6e0de329106ae1d34be874ea1695859
+R 67f36e9dbaba8a59d341f8d5b8046ceb
+U drh
+Z 5b04f3e9d03d2969d7a4a1df2153634f
 # Remove this line to create a well-formed Fossil manifest.
index f84abf38002e3189f699e727687bbd93b37ec30f..b896730f1ba2786bfe44db2681a0070026cf5d3e 100644 (file)
@@ -1 +1 @@
-b4b9dc632b06f932759bc2fceeb6fa1dd6e0de329106ae1d34be874ea1695859
+bb49dfc948048779a30deff9a3d1bb39846f6f72c26a2bdcdd0e386251720fe6
index e69ade52e34896d828c77c3ad113f7f3807aa7f1..c8c94ec8d9d156a91ba62239105994a7ac703ae0 100644 (file)
@@ -515,7 +515,10 @@ static void transferJoinMarkings(Expr *pDerived, Expr *pBase){
 static void markTermAsChild(WhereClause *pWC, int iChild, int iParent){
   pWC->a[iChild].iParent = iParent;
   pWC->a[iChild].truthProb = pWC->a[iParent].truthProb;
+  assert(   pWC->a[iParent].nChild <  UMXV(pWC->a[0].nChild) );
   pWC->a[iParent].nChild++;
+  testcase( pWC->a[iParent].nChild == UMXV(pWC->a[0].nChild) );
+
 }
 
 /*
@@ -1292,6 +1295,7 @@ static void exprAnalyze(
     pList = pExpr->x.pList;
     assert( pList!=0 );
     assert( pList->nExpr==2 );
+    assert( pWC->a[idxTerm].nChild==0 );
     for(i=0; i<2; i++){
       Expr *pNewExpr;
       int idxNew;
@@ -1502,8 +1506,11 @@ static void exprAnalyze(
    && pExpr->x.pSelect->pWin==0
 #endif
    && pWC->op==TK_AND
+   && pExpr->x.pSelect->pEList->nExpr <= UMXV(pTerm->nChild)
+   /* ^-- See bug 2026-06-04T10:00:49Z */
   ){
     int i;
+    assert( pTerm->nChild==0 );
     for(i=0; i<sqlite3ExprVectorSize(pExpr->pLeft); i++){
       int idxNew;
       idxNew = whereClauseInsert(pWC, pExpr, TERM_VIRTUAL|TERM_SLICE);