Avoid reading the -1-th element of an array in the query planner. Fix to a
bug introduced by check-in [8e2b25f9b8a7] from earlier today. Curiously, the problem only appeared on 32-bit systems. FossilOrigin-Name: 443913d582bcd953d85159047541592e2f68ade3
This commit is contained in:
parent
432697467f
commit
c436a03d02
12
manifest
12
manifest
@ -1,5 +1,5 @@
|
||||
C Add\sto\ssqlite3_analyzer\scommand-line\soptions\s--version\sand\s--tclsh,\sand\salso\nthe\sundocumented\s--debug\soption.
|
||||
D 2016-10-12T18:26:26.364
|
||||
C Avoid\sreading\sthe\s-1-th\selement\sof\san\sarray\sin\sthe\squery\splanner.\s\sFix\sto\sa\nbug\sintroduced\sby\scheck-in\s[8e2b25f9b8a7]\sfrom\searlier\stoday.\s\sCuriously,\nthe\sproblem\sonly\sappeared\son\s32-bit\ssystems.
|
||||
D 2016-10-12T18:55:53.185
|
||||
F Makefile.in 6fd48ffcf7c2deea7499062d1f3747f986c19678
|
||||
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
|
||||
F Makefile.msc 5151cc64c4c05f3455f4f692ad11410a810d937f
|
||||
@ -467,7 +467,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9
|
||||
F src/wal.c 02eeecc265f6ffd0597378f5d8ae9070b62a406a
|
||||
F src/wal.h 6dd221ed384afdc204bc61e25c23ef7fd5a511f2
|
||||
F src/walker.c 91a6df7435827e41cff6bb7df50ea00934ee78b0
|
||||
F src/where.c 7e454887a70a8263f663eab8c9d0f6ecc8ec7ac7
|
||||
F src/where.c 5f846d94bb3d35b3146d9915eb301ee362957b0a
|
||||
F src/whereInt.h 2bcc3d176e6091cb8f50a30b65c006e88a73614d
|
||||
F src/wherecode.c 717a65294df46f30e9b9933d2a63a4bcbca5a9a8
|
||||
F src/whereexpr.c 379d0017fb7bc9e5a4d8cd4b056c747de946430e
|
||||
@ -1525,7 +1525,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 61f0526978af667781c57bcc87510e4524efd0d8
|
||||
R 939be1793993bb5a0733cfe788e02f4d
|
||||
P e87d02d289a2016ea3ee074e914b07a8ac22b21f
|
||||
R 347ceac05d5e830be9b0b453b9055752
|
||||
U drh
|
||||
Z 3046f41ed5ee9baf8f6c825aaff1459e
|
||||
Z f6a48b076f4d91846fe2072e2532d39d
|
||||
|
@ -1 +1 @@
|
||||
e87d02d289a2016ea3ee074e914b07a8ac22b21f
|
||||
443913d582bcd953d85159047541592e2f68ade3
|
24
src/where.c
24
src/where.c
@ -4123,19 +4123,21 @@ static int wherePathSolver(WhereInfo *pWInfo, LogEst nRowEst){
|
||||
pWInfo->nOBSat = pFrom->isOrdered;
|
||||
pWInfo->revMask = pFrom->revLoop;
|
||||
if( pWInfo->nOBSat<=0 ){
|
||||
u32 wsFlags = pFrom->aLoop[nLoop-1]->wsFlags;
|
||||
pWInfo->nOBSat = 0;
|
||||
if( nLoop>0 && (wsFlags & WHERE_ONEROW)==0
|
||||
&& (wsFlags & (WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN)
|
||||
){
|
||||
Bitmask m = 0;
|
||||
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
|
||||
if( nLoop>0 ){
|
||||
u32 wsFlags = pFrom->aLoop[nLoop-1]->wsFlags;
|
||||
if( (wsFlags & WHERE_ONEROW)==0
|
||||
&& (wsFlags&(WHERE_IPK|WHERE_COLUMN_IN))!=(WHERE_IPK|WHERE_COLUMN_IN)
|
||||
){
|
||||
Bitmask m = 0;
|
||||
int rc = wherePathSatisfiesOrderBy(pWInfo, pWInfo->pOrderBy, pFrom,
|
||||
WHERE_ORDERBY_LIMIT, nLoop-1, pFrom->aLoop[nLoop-1], &m);
|
||||
testcase( wsFlags & WHERE_IPK );
|
||||
testcase( wsFlags & WHERE_COLUMN_IN );
|
||||
if( rc==pWInfo->pOrderBy->nExpr ){
|
||||
pWInfo->bOrderedInnerLoop = 1;
|
||||
pWInfo->revMask = m;
|
||||
testcase( wsFlags & WHERE_IPK );
|
||||
testcase( wsFlags & WHERE_COLUMN_IN );
|
||||
if( rc==pWInfo->pOrderBy->nExpr ){
|
||||
pWInfo->bOrderedInnerLoop = 1;
|
||||
pWInfo->revMask = m;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user