From: drh Date: Sun, 26 Jun 2016 04:06:28 +0000 (+0000) Subject: Prevent the WhereLoop.rSetup cost estimate from going negative on complex X-Git-Tag: version-3.14.0~87 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=05d1bad67458843adb41c9f77dabb22aa6cd0084;p=thirdparty%2Fsqlite.git Prevent the WhereLoop.rSetup cost estimate from going negative on complex queries. FossilOrigin-Name: f81050859170c8708a1b296da8dd3ef0dd314a11 --- diff --git a/manifest b/manifest index cd94ec1c26..2dd253cf30 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sthe\shandling\sof\sOP_Eq\sopcodes\sthat\scompare\sa\sregister\sagainst\sitself\nand\sthat\srequire\san\saffinity\schange. -D 2016-06-25T11:43:47.381 +C Prevent\sthe\sWhereLoop.rSetup\scost\sestimate\sfrom\sgoing\snegative\son\scomplex\nqueries. +D 2016-06-26T04:06:28.081 F Makefile.in bc2b4864a23a4a21c3e26d7b4350f51bab324d45 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 50149765ef72f4e652b9a0f1f6462c4784bb9423 @@ -462,7 +462,7 @@ F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 F src/wal.c 02eeecc265f6ffd0597378f5d8ae9070b62a406a F src/wal.h 2f7c831cf3b071fa548bf2d5cac640846a7ff19c F src/walker.c 0f142b5bd3ed2041fc52d773880748b212e63354 -F src/where.c 0ce4793497af2feb051147a5cc6356f95d3ab381 +F src/where.c 48eed8ebe319c6cbc7bf7682018f32af0f5189f5 F src/whereInt.h e5b939701a7ceffc5a3a8188a37f9746416ebcd0 F src/wherecode.c e20cb381ff621e56a4684c71e31999aca2547ca6 F src/whereexpr.c c32d47085dbaca0b8fd013210f56693c7d220d48 @@ -1502,7 +1502,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 77e4f7a36e6e0ebe842bcb36b2557a5bfba90d3f -R 3ef1ee60339b9a478f36c983b60b7e48 +P 507014e4c7a70cd09410c89c8ed466c8edab39d2 +R ae55d782914cbf2db58c75f82f862316 U drh -Z 7d552df043719cedc46422a9795a23bd +Z e21bca843071316b56d3c29d5bf9cc08 diff --git a/manifest.uuid b/manifest.uuid index 9ea9790f27..ee49eb40ac 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -507014e4c7a70cd09410c89c8ed466c8edab39d2 \ No newline at end of file +f81050859170c8708a1b296da8dd3ef0dd314a11 \ No newline at end of file diff --git a/src/where.c b/src/where.c index 46fcb4a158..a65f30968e 100644 --- a/src/where.c +++ b/src/where.c @@ -2701,6 +2701,7 @@ static int whereLoopAddBtree( pNew->rSetup += 24; } ApplyCostMultiplier(pNew->rSetup, pTab->costMult); + if( pNew->rSetup<0 ) pNew->rSetup = 0; /* TUNING: Each index lookup yields 20 rows in the table. This ** is more than the usual guess of 10 rows, since we have no way ** of knowing how selective the index will ultimately be. It would