From: drh Date: Thu, 7 Jun 2018 18:01:21 +0000 (+0000) Subject: Fix the assert()s in the byte-code engine that prove that cursors X-Git-Tag: version-3.25.0~207^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fmultikey-opt-idea;p=thirdparty%2Fsqlite.git Fix the assert()s in the byte-code engine that prove that cursors are unidirectional. FossilOrigin-Name: 4b0b4e14039469b656662312a5f80f086ede293e9ad04c7bc99a202b683a1e55 --- diff --git a/manifest b/manifest index 4757702e64..660acafd9a 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Remove\sthe\sNextIfOpen\sand\sPrevIfOpen\sopcodes\swhich\sare\sno\slonger\sneeded\nwhen\sthe\sIN-early-out\soptimization\sis\sworking. -D 2018-06-07T17:32:59.729 +C Fix\sthe\sassert()s\sin\sthe\sbyte-code\sengine\sthat\sprove\sthat\scursors\nare\sunidirectional. +D 2018-06-07T18:01:21.263 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F Makefile.in bfc40f350586923e0419d2ea4b559c37ec10ee4b6e210e08c14401f8e340f0da @@ -565,7 +565,7 @@ F src/upsert.c 47edd408cc73f8d3c00a140550d1ad180b407c146285947969dd09874802bf88 F src/utf.c 810fbfebe12359f10bc2a011520a6e10879ab2a163bcb26c74768eab82ea62a5 F src/util.c d9eb0a6c4aae1b00a7369eadd7ca0bbe946cb4c953b6751aa20d357c2f482157 F src/vacuum.c 36e7d21a20c0bf6ef4ef7c399d192b5239410b7c4d3c1070fba4e30810d0b855 -F src/vdbe.c 3b8517d41c514a6e892f20a74c69d9c04849fe45fb676703f5c6672f11fca97f +F src/vdbe.c d7a475cec51c83daf0d348301a1aec77f535832ea946632b5738ff9f087c0edb F src/vdbe.h e3f43bcc27ff30b0f25a6104d0cb5657e1c4b5e1b5cd2dd2216d5bcc2156a746 F src/vdbeInt.h d299d7a19853463dac418de0d97f2dd9cb4ddb495a45c93364e2daee109ba0ef F src/vdbeapi.c 765a0bbe01311626417de6cb743f7f25f9f98435c98a9df4bb0714d11014633d @@ -1731,7 +1731,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 085e863713a3f2d420c0076b275a6ac445a59d4d93f9eb0e8503b4e3f5589249 -R 2dde483ff37edacba64e59586d1522f4 +P 439c8162272795b422a0e01b01b832fbc12b39914c9632a674162af8bdecff98 +R fe7d026f8be3134e2723fc39eeec5ed5 U drh -Z b644b027a94a428792d2674b80d687cf +Z 8c642b57392b756fd19e94b953870085 diff --git a/manifest.uuid b/manifest.uuid index 2495bdfd74..9c15183170 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -439c8162272795b422a0e01b01b832fbc12b39914c9632a674162af8bdecff98 \ No newline at end of file +4b0b4e14039469b656662312a5f80f086ede293e9ad04c7bc99a202b683a1e55 \ No newline at end of file diff --git a/src/vdbe.c b/src/vdbe.c index 7a25eea0e6..243e4fe70a 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -4292,7 +4292,7 @@ case OP_NotExists: /* jump, in3 */ pC = p->apCsr[pOp->p1]; assert( pC!=0 ); #ifdef SQLITE_DEBUG - pC->seekOp = 0; + pC->seekOp = OP_SeekRowid; #endif assert( pC->isTable ); assert( pC->eCurType==CURTYPE_BTREE ); @@ -4946,6 +4946,9 @@ case OP_NullRow: { assert( pC->uc.pCursor!=0 ); sqlite3BtreeClearCursor(pC->uc.pCursor); } +#ifdef SQLITE_DEBUG + if( pC->seekOp==0 ) pC->seekOp = OP_NullRow; +#endif break; } @@ -5185,16 +5188,16 @@ case OP_Next: /* jump */ assert( pOp->opcode!=OP_Next || pOp->p4.xAdvance==sqlite3BtreeNext ); assert( pOp->opcode!=OP_Prev || pOp->p4.xAdvance==sqlite3BtreePrevious ); -#if 0 - /* The Next opcode is only used after SeekGT, SeekGE, and Rewind. + /* The Next opcode is only used after SeekGT, SeekGE, Rewind, and Found. ** The Prev opcode is only used after SeekLT, SeekLE, and Last. */ assert( pOp->opcode!=OP_Next || pC->seekOp==OP_SeekGT || pC->seekOp==OP_SeekGE - || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found); + || pC->seekOp==OP_Rewind || pC->seekOp==OP_Found + || pC->seekOp==OP_NullRow); assert( pOp->opcode!=OP_Prev || pC->seekOp==OP_SeekLT || pC->seekOp==OP_SeekLE - || pC->seekOp==OP_Last ); -#endif + || pC->seekOp==OP_Last + || pC->seekOp==OP_NullRow); rc = pOp->p4.xAdvance(pC->uc.pCursor, pOp->p3); next_tail: