]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
For DELETE operations, make sure that seeks on the main table are not
authordrh <drh@noemail.net>
Fri, 6 May 2016 16:49:54 +0000 (16:49 +0000)
committerdrh <drh@noemail.net>
Fri, 6 May 2016 16:49:54 +0000 (16:49 +0000)
deferred, since if they are and none of the indexes reference columns of
the table, the seek might never occur until the OP_Delete opcode, which is
too late.  Fix for ticket [16c9801ceba49].

FossilOrigin-Name: 93a2bace5704f7ecad56541a6b3e06a88f7f393f

1  2 
manifest
manifest.uuid
src/sqliteInt.h

diff --cc manifest
index 0525e61f73f864ba0b6bfb6ec893347ae91cca2b,459b5d372731e3af83ff6efeed5be4e3a2e989bc..6fd1d2d4023eedfea5bea28edf7dc53bedd81801
+++ b/manifest
@@@ -1,5 -1,5 +1,5 @@@
- C Fix\san\serror\sin\smain.mk\scausing\stestfixture\sto\suse\sindividual\sfts5\ssource\scode\sfiles\sinstead\sof\sfts5.c.
- D 2016-05-06T16:30:34.529
 -C In\sthe\sWHERE\sgenerator,\swhen\sbuilding\scode\sfor\sa\sDELETE\soperation,\smake\ssure\nthat\sseeks\sto\sthe\smain\stable\sare\snot\sdeferred.\nThis\sis\sa\sbetter\sfix\sfor\sthe\s[16c9801ceba49]\sbug\sthan\sthe\sprevious.
 -D 2016-05-06T16:06:59.602
++C For\sDELETE\soperations,\smake\ssure\sthat\sseeks\son\sthe\smain\stable\sare\snot\ndeferred,\ssince\sif\sthey\sare\sand\snone\sof\sthe\sindexes\sreference\scolumns\sof\nthe\stable,\sthe\sseek\smight\snever\soccur\suntil\sthe\sOP_Delete\sopcode,\swhich\sis\ntoo\slate.\s\sFix\sfor\sticket\s[16c9801ceba49].
++D 2016-05-06T16:49:54.299
  F Makefile.in 9eda6e1c90d05c199c3ec8a7069b0682ad307657
  F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
  F Makefile.msc db82b35aef27f412fef14d8534afc022138bcdfd
@@@ -382,7 -382,7 +382,7 @@@ F src/shell.c 14ff7f660530a52b117d110ba
  F src/sqlite.h.in 9984129d86243424b765fcb3f147c697bd20bb54
  F src/sqlite3.rc 5121c9e10c3964d5755191c80dd1180c122fc3a8
  F src/sqlite3ext.h 98f72cbfe00169c39089115427d06ea05fe4b4a2
- F src/sqliteInt.h c8483dd77894a72d38a76b6251a4ac949a37d6e8
 -F src/sqliteInt.h 4ab5884aa7dd1cfbb1a34f60d8a919f6584c4aa1
++F src/sqliteInt.h 8ec741711b8f42aae2c7a22e3d04f15270e0b6be
  F src/sqliteLimit.h c0373387c287c8d0932510b5547ecde31b5da247
  F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba
  F src/table.c 5226df15ab9179b9ed558d89575ea0ce37b03fc9
@@@ -1487,7 -1487,7 +1487,8 @@@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a9
  F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
  F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
  F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
- P dc37750d4e87d0c529785adceeebd838b8f8591d
- R c15766ea1c9925837a701d30f137e7d3
- U dan
- Z ee202f54aac91dd67f57f6a979bc066b
 -P 50312273ffaf1bd4bfdc73865fa0b19166968429
 -R 0aaabe1d44ff452855f4b1d0d09524f8
++P 933a1c818c1d1ccec8680e1ba87f2cbe37cc9f7d 150dd09ebd7b17234a79e1811a0fae8b0a7a40d5
++R 999c47253628cf8504ca9429ccbba492
++T +closed 150dd09ebd7b17234a79e1811a0fae8b0a7a40d5
+ U drh
 -Z 9200ae75c074ea360e36df5da26c6a08
++Z 0a4c84a453e835d42d347d7d3d2d52db
diff --cc manifest.uuid
index e0a918072d9f51b6b193dfb6bcf5ea1138b59102,709cd8f436511702caea211933abd2d03066bb80..f2214b4f51450a46309f1281a0fc7e627cf247ba
@@@ -1,1 -1,1 +1,1 @@@
- 933a1c818c1d1ccec8680e1ba87f2cbe37cc9f7d
 -150dd09ebd7b17234a79e1811a0fae8b0a7a40d5
++93a2bace5704f7ecad56541a6b3e06a88f7f393f
diff --cc src/sqliteInt.h
index 783f0f56c3edd0000ce6e39136ff1b47fb7d1eb9,de06f6d7d8921fd85ac7c8ea1148e746405fac4e..f9635a4eb0a52a4751fb49670f45b1713a4598ec
@@@ -2543,6 -2543,7 +2543,7 @@@ struct SrcList 
  #define WHERE_REOPEN_IDX       0x1000 /* Try to use OP_ReopenIdx */
  #define WHERE_ONEPASS_MULTIROW 0x2000 /* ONEPASS is ok with multiple rows */
  #define WHERE_USE_LIMIT        0x4000 /* There is a constant LIMIT clause */
 -#define WHERE_SEEK_TABLE       0x8000 /* Always seek the main table */
++#define WHERE_SEEK_TABLE       0x8000 /* Do not defer seeks on main table */
  
  /* Allowed return values from sqlite3WhereIsDistinct()
  */