]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Improve the comments on the generated byte-code for the merge algorithm.
authordrh <>
Mon, 26 Jan 2026 19:37:57 +0000 (19:37 +0000)
committerdrh <>
Mon, 26 Jan 2026 19:37:57 +0000 (19:37 +0000)
FossilOrigin-Name: 4468c9e1a262d3d7efd8edff19e22e13b64ebed606ce2f18c9cabce93ef257d3

manifest
manifest.uuid
src/select.c

index 7764d375db215535230a2468e162dd2746754efe..5e17262e34fdde0cd583140a3543e0905e0df543 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sthe\sinitialization\sof\sthe\ssqlite3Api&#91;&#93;\sconstant\sto\sconform\nwith\sthe\sprevious\scheck-in.
-D 2026-01-26T13:54:05.263
+C Improve\sthe\scomments\son\sthe\sgenerated\sbyte-code\sfor\sthe\smerge\salgorithm.
+D 2026-01-26T19:37:57.101
 F .fossil-settings/binary-glob 61195414528fb3ea9693577e1980230d78a1f8b0a54c78cf1b9b24d0a409ed6a x
 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
@@ -738,7 +738,7 @@ F src/printf.c b1b29b5e58e1530d5daeee5963d3c318d8ab2d7e38437580e28755753e0c1ded
 F src/random.c 606b00941a1d7dd09c381d3279a058d771f406c5213c9932bbd93d5587be4b9c
 F src/resolve.c 47aa7fdc9ec4c19b103ac5e79d7887d30119b5675309facf5eed1118391c868b
 F src/rowset.c 8432130e6c344b3401a8874c3cb49fefe6873fec593294de077afea2dce5ec97
-F src/select.c 65d7ffa2af9670b5e9ca2b23a98a92cd4a32c12b098edeff80e6df61da9b9a6e
+F src/select.c 36697f8ef0b3fc36534c0cb0c97676fc92480b7572c0bb89f711cf85aea0f3c1
 F src/shell.c.in e8818572acd50464bc00426fe0d755e98239f73d531437c3dc7721d1fecb1231
 F src/sqlite.h.in 8bcbaecfe2cbecf8c5c1381354fcdd7d307443e88b4953fccb222456c1267b61
 F src/sqlite3.rc 015537e6ac1eec6c7050e17b616c2ffe6f70fca241835a84a4f0d5937383c479
@@ -2193,8 +2193,8 @@ F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee
 F tool/warnings.sh d924598cf2f55a4ecbc2aeb055c10bd5f48114793e7ba25f9585435da29e7e98
 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f
 F tool/winmain.c 00c8fb88e365c9017db14c73d3c78af62194d9644feaf60e220ab0f411f3604c
-P 925384d7711867428644595c0903682e6e365eb974c57e6680b51d511c980054
-R 3daf5163e8b291357ab116f4bec90549
+P 0a31a740843404958f61798aa17f94b5162bcf467c1c863d745346a316160d13
+R a646da844a0a9f4eff9b8bd2ff9a13ac
 U drh
-Z 80a0a2c751c2033e7b7396c45c50bd8d
+Z 374041111aeec3f87f7b10d8573edbe3
 # Remove this line to create a well-formed Fossil manifest.
index 5b95f300cc4361ad488cd395e2384e9b8c8c19e4..a0cf458d35f96c4d479f3711bc84ccd65d36b4bd 100644 (file)
@@ -1 +1 @@
-0a31a740843404958f61798aa17f94b5162bcf467c1c863d745346a316160d13
+4468c9e1a262d3d7efd8edff19e22e13b64ebed606ce2f18c9cabce93ef257d3
index aef1c67b670ac959b63fb1958746ce337fd1b1a6..a1d3cf8837bf8e4c8bad4efe762441a51e7f1c28 100644 (file)
@@ -3582,7 +3582,7 @@ static int multiSelectByMerge(
   */
   addrSelectA = sqlite3VdbeCurrentAddr(v) + 1;
   addr1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrA, 0, addrSelectA);
-  VdbeComment((v, "left SELECT"));
+  VdbeComment((v, "SUBR: next-A"));
   pPrior->iLimit = regLimitA;
   ExplainQueryPlan((pParse, 1, "LEFT"));
   sqlite3Select(pParse, pPrior, &destA);
@@ -3594,7 +3594,7 @@ static int multiSelectByMerge(
   */
   addrSelectB = sqlite3VdbeCurrentAddr(v) + 1;
   addr1 = sqlite3VdbeAddOp3(v, OP_InitCoroutine, regAddrB, 0, addrSelectB);
-  VdbeComment((v, "right SELECT"));
+  VdbeComment((v, "SUBR: next-B"));
   savedLimit = p->iLimit;
   savedOffset = p->iOffset;
   p->iLimit = regLimitB;
@@ -3608,7 +3608,7 @@ static int multiSelectByMerge(
   /* Generate a subroutine that outputs the current row of the A
   ** select as the next output row of the compound select.
   */
-  VdbeNoopComment((v, "Output routine for A"));
+  VdbeNoopComment((v, "SUBR: out-A"));
   addrOutA = generateOutputSubroutine(pParse,
                  p, &destA, pDest, regOutA,
                  regPrev, pKeyDup, labelEnd);
@@ -3617,7 +3617,7 @@ static int multiSelectByMerge(
   ** select as the next output row of the compound select.
   */
   if( op==TK_ALL || op==TK_UNION ){
-    VdbeNoopComment((v, "Output routine for B"));
+    VdbeNoopComment((v, "SUBR: out-B"));
     addrOutB = generateOutputSubroutine(pParse,
                  p, &destB, pDest, regOutB,
                  regPrev, pKeyDup, labelEnd);
@@ -3630,10 +3630,12 @@ static int multiSelectByMerge(
   if( op==TK_EXCEPT || op==TK_INTERSECT ){
     addrEofA_noB = addrEofA = labelEnd;
   }else{ 
-    VdbeNoopComment((v, "eof-A subroutine"));
+    VdbeNoopComment((v, "SUBR: eof-A"));
     addrEofA = sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB);
+    VdbeComment((v, "out-B"));
     addrEofA_noB = sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, labelEnd);
                                      VdbeCoverage(v);
+    VdbeComment((v, "next-B"));
     sqlite3VdbeGoto(v, addrEofA);
     p->nSelectRow = sqlite3LogEstAdd(p->nSelectRow, pPrior->nSelectRow);
   }
@@ -3645,17 +3647,21 @@ static int multiSelectByMerge(
     addrEofB = addrEofA;
     if( p->nSelectRow > pPrior->nSelectRow ) p->nSelectRow = pPrior->nSelectRow;
   }else{ 
-    VdbeNoopComment((v, "eof-B subroutine"));
+    VdbeNoopComment((v, "SUBR: eof-B"));
     addrEofB = sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA);
+    VdbeComment((v, "out-A"));
     sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, labelEnd); VdbeCoverage(v);
+    VdbeComment((v, "next-A"));
     sqlite3VdbeGoto(v, addrEofB);
   }
 
   /* Generate code to handle the case of A<B
   */
-  VdbeNoopComment((v, "A-lt-B subroutine"));
+  VdbeNoopComment((v, "SUBR: A-lt-B"));
   addrAltB = sqlite3VdbeAddOp2(v, OP_Gosub, regOutA, addrOutA);
+  VdbeComment((v, "out-A"));
   sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, addrEofA); VdbeCoverage(v);
+  VdbeComment((v, "next-A"));
   sqlite3VdbeGoto(v, labelCmpr);
 
   /* Generate code to handle the case of A==B
@@ -3666,20 +3672,23 @@ static int multiSelectByMerge(
     addrAeqB = addrAltB;
     addrAltB++;
   }else{
-    VdbeNoopComment((v, "A-eq-B subroutine"));
+    VdbeNoopComment((v, "SUBR: A-eq-B"));
     addrAeqB =
     sqlite3VdbeAddOp2(v, OP_Yield, regAddrA, addrEofA); VdbeCoverage(v);
+    VdbeComment((v, "next-A"));
     sqlite3VdbeGoto(v, labelCmpr);
   }
 
   /* Generate code to handle the case of A>B
   */
-  VdbeNoopComment((v, "A-gt-B subroutine"));
+  VdbeNoopComment((v, "SUBR: A-gt-B"));
   addrAgtB = sqlite3VdbeCurrentAddr(v);
   if( op==TK_ALL || op==TK_UNION ){
     sqlite3VdbeAddOp2(v, OP_Gosub, regOutB, addrOutB);
+    VdbeComment((v, "out-B"));
   }
   sqlite3VdbeAddOp2(v, OP_Yield, regAddrB, addrEofB); VdbeCoverage(v);
+  VdbeComment((v, "next-B"));
   sqlite3VdbeGoto(v, labelCmpr);
 
   /* This code runs once to initialize everything.