1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-12 13:01:09 +03:00

Clear the sort-order flags on the KeyInfo object associated with the

OP_Compare/OP_Jump of the block-sort logic, in order to make the OP_Jump
fully testable.

FossilOrigin-Name: 9b2838f23e5f52369eeb078f60bd231cc54362f8
This commit is contained in:
drh
2014-03-22 02:19:53 +00:00
parent c83a6bed04
commit dbfca2b7f8
3 changed files with 11 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
C Increase\sthe\sversion\snumber\sto\s3.8.5. C Clear\sthe\ssort-order\sflags\son\sthe\sKeyInfo\sobject\sassociated\swith\sthe\nOP_Compare/OP_Jump\sof\sthe\sblock-sort\slogic,\sin\sorder\sto\smake\sthe\sOP_Jump\nfully\stestable.
D 2014-03-22T01:52:17.580 D 2014-03-22T02:19:53.523
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81 F Makefile.in 2ef13430cd359f7b361bb863504e227b25cc7f81
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
@@ -217,7 +217,7 @@ F src/printf.c e5a0005f8b3de21f85da6a709d2fbee76775bf4b
F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece F src/random.c d10c1f85b6709ca97278428fd5db5bbb9c74eece
F src/resolve.c 273d5f47c4e2c05b2d3d2bffeda939551ab59e66 F src/resolve.c 273d5f47c4e2c05b2d3d2bffeda939551ab59e66
F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0 F src/rowset.c 64655f1a627c9c212d9ab497899e7424a34222e0
F src/select.c 89bfc2228c6dda5200040d3c61a67a7fc815a24e F src/select.c 269c3e31a450fce642a10569221a49180348c88e
F src/shell.c cee9f46f2688a261601b1fd3d7f4b3cddf9b5cdf F src/shell.c cee9f46f2688a261601b1fd3d7f4b3cddf9b5cdf
F src/sqlite.h.in a2ef671f92747a5a1c8a47bad5c585a8dd9eca80 F src/sqlite.h.in a2ef671f92747a5a1c8a47bad5c585a8dd9eca80
F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e F src/sqlite3.rc 11094cc6a157a028b301a9f06b3d03089ea37c3e
@@ -1157,7 +1157,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1
F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4
F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01 F tool/warnings.sh d1a6de74685f360ab718efda6265994b99bbea01
F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff F tool/win/sqlite.vsix 030f3eeaf2cb811a3692ab9c14d021a75ce41fff
P c36f74611cf17ad2ff198a2ac2054d7ab451a72c P 9760879d086b61476890927f01806a93798d4eee
R c87966e812e5349386ca47468f11243f R 9c4612b02334319090d26af6339ff92f
U drh U drh
Z 4135b8e90212e093f926ac90192216e8 Z c09bf15737bf88995e1679f9f666a1a6

View File

@@ -1 +1 @@
9760879d086b61476890927f01806a93798d4eee 9b2838f23e5f52369eeb078f60bd231cc54362f8

View File

@@ -481,6 +481,7 @@ static void pushOntoSorter(
int addrJmp; /* Address of the OP_Jump opcode */ int addrJmp; /* Address of the OP_Jump opcode */
VdbeOp *pOp; /* Opcode that opens the sorter */ VdbeOp *pOp; /* Opcode that opens the sorter */
int nKey; /* Number of sorting key columns, including OP_Sequence */ int nKey; /* Number of sorting key columns, including OP_Sequence */
KeyInfo *pKI; /* Original KeyInfo on the sorter table */
regPrevKey = pParse->nMem+1; regPrevKey = pParse->nMem+1;
pParse->nMem += pSort->nOBSat; pParse->nMem += pSort->nOBSat;
@@ -490,7 +491,9 @@ static void pushOntoSorter(
pOp = sqlite3VdbeGetOp(v, pSort->addrSortIndex); pOp = sqlite3VdbeGetOp(v, pSort->addrSortIndex);
if( pParse->db->mallocFailed ) return; if( pParse->db->mallocFailed ) return;
pOp->p2 = nKey + 1; pOp->p2 = nKey + 1;
sqlite3VdbeChangeP4(v, -1, (char*)pOp->p4.pKeyInfo, P4_KEYINFO); pKI = pOp->p4.pKeyInfo;
memset(pKI->aSortOrder, 0, pKI->nField); /* Makes OP_Jump below testable */
sqlite3VdbeChangeP4(v, -1, (char*)pKI, P4_KEYINFO);
pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat, 1); pOp->p4.pKeyInfo = keyInfoFromExprList(pParse, pSort->pOrderBy, nOBSat, 1);
addrJmp = sqlite3VdbeCurrentAddr(v); addrJmp = sqlite3VdbeCurrentAddr(v);
sqlite3VdbeAddOp3(v, OP_Jump, addrJmp+1, 0, addrJmp+1); VdbeCoverage(v); sqlite3VdbeAddOp3(v, OP_Jump, addrJmp+1, 0, addrJmp+1); VdbeCoverage(v);