-C Avoid\san\sunnecessary\sbtree\sseek\swhile\sdeleting\san\sindex\sentry\sdue\sto\sa\sconflict\non\sa\sREPLACE\soperation.
-D 2017-01-07T03:26:50.193
+C Critical\sfix\sto\sthe\sprevious\scheck-in\sso\sthat\sit\sworks\swhen\sthere\sare\nBEFORE\striggers\sthat\smove\sthe\scursor\sbefore\sthe\sOP_Delete\shas\sa\schance\sto\nbe\sapplied.
+D 2017-01-07T14:26:28.809
F Makefile.in 41bd4cad981487345c4a84081074bcdb876e4b2e
F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434
F Makefile.msc b8ca53350ae545e3562403d5da2a69cec79308da
F src/ctime.c 9f2296a4e5d26ebf0e0d95a0af4628f1ea694e7a
F src/date.c dc3f1391d9297f8c748132813aaffcb117090d6e
F src/dbstat.c 19ee7a4e89979d4df8e44cfac7a8f905ec89b77d
-F src/delete.c 1a443cedfff0420959416a09f55119973f803593
+F src/delete.c 4220f4feee7fddefc1e73e5ade1ed82ffe8dc92a
F src/expr.c f06f41e5e5daca10fb090e70a2502dcc0dbc992b
F src/fault.c 460f3e55994363812d9d60844b2a6de88826e007
F src/fkey.c 2e9aabe1aee76273aff8a84ee92c464e095400ae
F src/hash.h ab34c5c54a9e9de2e790b24349ba5aab3dbb4fd4
F src/hwtime.h 747c1bbe9df21a92e9c50f3bbec1de841dc5e5da
F src/in-operator.md 10cd8f4bcd225a32518407c2fb2484089112fd71
-F src/insert.c ad2a0b2757a23b6f9297ee414eeab22b52fbde75
+F src/insert.c 3b7fbb149ef249269bfbedabbe8fd706ef9a2317
F src/legacy.c 75d3023be8f0d2b99d60f905090341a03358c58e
F src/loadext.c 5d6642d141c07d366e43d359e94ec9de47add41d
F src/main.c e207b81542d13b9f13d61e78ca441f9781f055b0
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
-P d577dda0a7fbfacda57e8cad2bc4651d2a05d813
-R 9a736b4439c4e25faa8492f344a490a5
+P f0495c5133d0dc04d63521136d6b9ca440792cdf
+R 21f1a5c5760681e8d66bbbeed4342953
U drh
-Z c755348d5a4bd2ab8fd825f60cd77850
+Z 06625003bcd408124313c9f36986c7f6
-f0495c5133d0dc04d63521136d6b9ca440792cdf
\ No newline at end of file
+db2c0960ffb3b396b20e0441d3edb812254c82bc
\ No newline at end of file
#endif
{
int count = (pParse->nested==0); /* True to count changes */
- int iIdxNoSeek = -1;
- if( bComplex==0 && aiCurOnePass[1]!=iDataCur ){
- iIdxNoSeek = aiCurOnePass[1];
- }
+ int iIdxNoSeek = bComplex ? -1 : aiCurOnePass[1];
sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
iKey, nKey, count, OE_Default, eOnePass, iIdxNoSeek);
}
**
** If eMode is ONEPASS_MULTI, then this call is being made as part
** of a ONEPASS delete that affects multiple rows. In this case, if
-** iIdxNoSeek is a valid cursor number (>=0), then its position should
-** be preserved following the delete operation. Or, if iIdxNoSeek is not
-** a valid cursor number, the position of iDataCur should be preserved
-** instead.
+** iIdxNoSeek is a valid cursor number (>=0) and is not the same as
+** iDataCur, then its position should be preserved following the delete
+** operation. Or, if iIdxNoSeek is not a valid cursor number, the
+** position of iDataCur should be preserved instead.
**
** iIdxNoSeek:
-** If iIdxNoSeek is a valid cursor number (>=0), then it identifies an
-** index cursor (from within array of cursors starting at iIdxCur) that
-** already points to the index entry to be deleted.
+** If iIdxNoSeek is a valid cursor number (>=0) not equal to iDataCur,
+** then it identifies an index cursor (from within array of cursors
+** starting at iIdxCur) that already points to the index entry to be deleted.
*/
void sqlite3GenerateRowDelete(
Parse *pParse, /* Parsing context */
/* If any BEFORE triggers were coded, then seek the cursor to the
** row to be deleted again. It may be that the BEFORE triggers moved
- ** the cursor or of already deleted the row that the cursor was
+ ** the cursor or already deleted the row that the cursor was
** pointing to.
*/
if( addrStart<sqlite3VdbeCurrentAddr(v) ){
}
sqlite3GenerateRowDelete(pParse, pTab, pTrigger, iDataCur, iIdxCur,
regR, nPkField, 0, OE_Replace,
- (pIdx==pPk ? ONEPASS_SINGLE : ONEPASS_OFF), iThisCur);
+ (pIdx==pPk ? ONEPASS_SINGLE : ONEPASS_OFF),
+ (pTrigger ? -1 : iThisCur));
seenReplace = 1;
break;
}