mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
Invert the meaning of the regBignull flag so that it is 1 when doing the
normal scan and 1 when scanning nulls. This enables the re-do jump at the bottom of the loop to be coded with a single OP_IfNotZero opcode, rather than a sequence of OP_If, OP_Integer, OP_Goto. FossilOrigin-Name: bf875e1a259a4167694e06349458452dc36c1d38aa6843518d9ae46ce74e5559
This commit is contained in:
16
manifest
16
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Extra\sVDBE\scomments\sin\sthe\sNULLS\sLAST\slogic\sprovide\slandmarks\sto\shelp\nunderstand\sthe\sEXPLAIN\soutput.
|
C Invert\sthe\smeaning\sof\sthe\sregBignull\sflag\sso\sthat\sit\sis\s1\swhen\sdoing\sthe\nnormal\sscan\sand\s1\swhen\sscanning\snulls.\s\sThis\senables\sthe\sre-do\sjump\sat\sthe\nbottom\sof\sthe\sloop\sto\sbe\scoded\swith\sa\ssingle\sOP_IfNotZero\sopcode,\srather\nthan\sa\ssequence\sof\sOP_If,\sOP_Integer,\sOP_Goto.
|
||||||
D 2019-08-23T13:08:49.776
|
D 2019-08-23T13:32:03.306
|
||||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||||
@@ -609,9 +609,9 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
|||||||
F src/wal.c bbd6838bd79c0a32144d482fb0b6a9d2d1a252fb3b16d5005ec30f2f80413b0d
|
F src/wal.c bbd6838bd79c0a32144d482fb0b6a9d2d1a252fb3b16d5005ec30f2f80413b0d
|
||||||
F src/wal.h 606292549f5a7be50b6227bd685fa76e3a4affad71bb8ac5ce4cb5c79f6a176a
|
F src/wal.h 606292549f5a7be50b6227bd685fa76e3a4affad71bb8ac5ce4cb5c79f6a176a
|
||||||
F src/walker.c d5a94907dcac990e31976be9dc769d17f6a806782593d6aec9d760ee01ec22cd
|
F src/walker.c d5a94907dcac990e31976be9dc769d17f6a806782593d6aec9d760ee01ec22cd
|
||||||
F src/where.c cba20474827dfb3e6bfe7835635e0f018a67d4b8faef4c90d4f28b81b81a8915
|
F src/where.c 10e21ac338582a4f87b2d09f09dd812c9bda0a0c4c456f54daeeee355afae733
|
||||||
F src/whereInt.h cce97c33db637c027bd6f3601a5ff845bd65c833b6465e3b091d48f6a7f51268
|
F src/whereInt.h 4a296fd4fa79fdcbc2b5e8c1b898901617655811223e1082b899c23ecb092217
|
||||||
F src/wherecode.c 1700806bb5bb507ff3614d0836893f35a5a5c438087ee6f373f2ecdf32156d71
|
F src/wherecode.c c02ff23ea48b8980d003817bd412e3ce7ce4982159a090566a24cb6101688a9d
|
||||||
F src/whereexpr.c 2757afbd5cfdbb420f9d0392e1bd5f5c0e33dee50a8c692befc7e502308e449f
|
F src/whereexpr.c 2757afbd5cfdbb420f9d0392e1bd5f5c0e33dee50a8c692befc7e502308e449f
|
||||||
F src/window.c 3ea716bb0dd5ffc8cdbaa48baffc525958b51bc61b2afd73a56baccfcd7ceb2f
|
F src/window.c 3ea716bb0dd5ffc8cdbaa48baffc525958b51bc61b2afd73a56baccfcd7ceb2f
|
||||||
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
F test/8_3_names.test ebbb5cd36741350040fd28b432ceadf495be25b2
|
||||||
@@ -1837,7 +1837,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
|||||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||||
P d3531f5be7d3769689e2cd8bdc9bab5608759de027d44cc123996f32a4a89583
|
P 649b08ead50f10a9ec0357a5e1ed020195d9f93be61ef703ea036a8e53f07a34
|
||||||
R ab23b496c06c535da116ba045bb5e66a
|
R c7fec8ea82d2ec3c4ef608bd58d88fd0
|
||||||
U drh
|
U drh
|
||||||
Z 115e4fb3e71b36cfad63bc3458a08668
|
Z 0dcd16d55adeefa06ece8236ed711d36
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
649b08ead50f10a9ec0357a5e1ed020195d9f93be61ef703ea036a8e53f07a34
|
bf875e1a259a4167694e06349458452dc36c1d38aa6843518d9ae46ce74e5559
|
||||||
@@ -5218,13 +5218,7 @@ void sqlite3WhereEnd(WhereInfo *pWInfo){
|
|||||||
VdbeCoverageIf(v, pLevel->op==OP_VNext);
|
VdbeCoverageIf(v, pLevel->op==OP_VNext);
|
||||||
if( pLevel->regBignull ){
|
if( pLevel->regBignull ){
|
||||||
sqlite3VdbeResolveLabel(v, pLevel->addrBignull);
|
sqlite3VdbeResolveLabel(v, pLevel->addrBignull);
|
||||||
addr = sqlite3VdbeAddOp1(v, OP_If, pLevel->regBignull);
|
sqlite3VdbeAddOp2(v, OP_IfNotZero, pLevel->regBignull, pLevel->p2-1);
|
||||||
VdbeComment((v, "If NULL-scan done"));
|
|
||||||
VdbeCoverage(v);
|
|
||||||
sqlite3VdbeAddOp2(v, OP_Integer, 1, pLevel->regBignull);
|
|
||||||
sqlite3VdbeAddOp2(v, OP_Goto, 0, pLevel->p2-1);
|
|
||||||
VdbeComment((v, "Do the NULL-scan"));
|
|
||||||
sqlite3VdbeJumpHere(v, addr);
|
|
||||||
}
|
}
|
||||||
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
|
#ifndef SQLITE_DISABLE_SKIPAHEAD_DISTINCT
|
||||||
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);
|
if( addrSeek ) sqlite3VdbeJumpHere(v, addrSeek);
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ struct WhereLevel {
|
|||||||
int addrCont; /* Jump here to continue with the next loop cycle */
|
int addrCont; /* Jump here to continue with the next loop cycle */
|
||||||
int addrFirst; /* First instruction of interior of the loop */
|
int addrFirst; /* First instruction of interior of the loop */
|
||||||
int addrBody; /* Beginning of the body of this loop */
|
int addrBody; /* Beginning of the body of this loop */
|
||||||
int regBignull; /* big-null flag reg. True if NULLs not yet scanned */
|
int regBignull; /* big-null flag reg. True if a NULL-scan is needed */
|
||||||
int addrBignull; /* Jump here for next part of big-null scan */
|
int addrBignull; /* Jump here for next part of big-null scan */
|
||||||
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
#ifndef SQLITE_LIKE_DOESNT_MATCH_BLOBS
|
||||||
u32 iLikeRepCntr; /* LIKE range processing counter register (times 2) */
|
u32 iLikeRepCntr; /* LIKE range processing counter register (times 2) */
|
||||||
|
|||||||
@@ -1690,8 +1690,8 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
|||||||
sqlite3VdbeAddOp1(v, OP_SeekHit, iIdxCur);
|
sqlite3VdbeAddOp1(v, OP_SeekHit, iIdxCur);
|
||||||
}
|
}
|
||||||
if( regBignull ){
|
if( regBignull ){
|
||||||
sqlite3VdbeAddOp2(v, OP_Integer, 0, regBignull);
|
sqlite3VdbeAddOp2(v, OP_Integer, 1, regBignull);
|
||||||
VdbeComment((v, "NULL-scan flag"));
|
VdbeComment((v, "NULL-scan needed flag"));
|
||||||
}
|
}
|
||||||
|
|
||||||
op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev];
|
op = aStartOp[(start_constraints<<2) + (startEq<<1) + bRev];
|
||||||
@@ -1776,8 +1776,8 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
|||||||
/* Check if the index cursor is past the end of the range. */
|
/* Check if the index cursor is past the end of the range. */
|
||||||
if( nConstraint ){
|
if( nConstraint ){
|
||||||
if( regBignull ){
|
if( regBignull ){
|
||||||
sqlite3VdbeAddOp2(v, OP_If, regBignull, sqlite3VdbeCurrentAddr(v)+3);
|
sqlite3VdbeAddOp2(v, OP_IfNot, regBignull, sqlite3VdbeCurrentAddr(v)+3);
|
||||||
VdbeComment((v, "If in NULL-scan"));
|
VdbeComment((v, "If NULL-scan active"));
|
||||||
VdbeCoverage(v);
|
VdbeCoverage(v);
|
||||||
}
|
}
|
||||||
op = aEndOp[bRev*2 + endEq];
|
op = aEndOp[bRev*2 + endEq];
|
||||||
@@ -1788,8 +1788,8 @@ Bitmask sqlite3WhereCodeOneLoopStart(
|
|||||||
testcase( op==OP_IdxLE ); VdbeCoverageIf(v, op==OP_IdxLE );
|
testcase( op==OP_IdxLE ); VdbeCoverageIf(v, op==OP_IdxLE );
|
||||||
}
|
}
|
||||||
if( regBignull ){
|
if( regBignull ){
|
||||||
sqlite3VdbeAddOp2(v, OP_IfNot, regBignull, sqlite3VdbeCurrentAddr(v)+2);
|
sqlite3VdbeAddOp2(v, OP_If, regBignull, sqlite3VdbeCurrentAddr(v)+2);
|
||||||
VdbeComment((v, "If not in NULL-scan"));
|
VdbeComment((v, "If NULL-scan pending"));
|
||||||
VdbeCoverage(v);
|
VdbeCoverage(v);
|
||||||
if( bStopAtNull ){
|
if( bStopAtNull ){
|
||||||
op = aEndOp[bRev*2 + 0];
|
op = aEndOp[bRev*2 + 0];
|
||||||
|
|||||||
Reference in New Issue
Block a user