aboutsummaryrefslogtreecommitdiff
path: root/src/wherecode.c
diff options
context:
space:
mode:
authordan <dan@noemail.net>2017-01-28 19:45:34 +0000
committerdan <dan@noemail.net>2017-01-28 19:45:34 +0000
commitf64ece143c4d71a5d8f8a67cd643cd0ef683c29e (patch)
treefd79fac6e7df4f4136514b17f75f9d76e52068d5 /src/wherecode.c
parent6034d476186cda5b18f6003b8c3f66cb0e216d16 (diff)
downloadsqlite-f64ece143c4d71a5d8f8a67cd643cd0ef683c29e.tar.gz
sqlite-f64ece143c4d71a5d8f8a67cd643cd0ef683c29e.zip
Avoid redundant table b-tree cursor seeks in UPDATE statements that use the
two-pass strategy. FossilOrigin-Name: dc555b1039c6930f6d15355c698ff917a85e8056
Diffstat (limited to 'src/wherecode.c')
-rw-r--r--src/wherecode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wherecode.c b/src/wherecode.c
index 032c56fef..58e040628 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -1591,7 +1591,10 @@ Bitmask sqlite3WhereCodeOneLoopStart(
if( omitTable ){
/* pIdx is a covering index. No need to access the main table. */
}else if( HasRowid(pIdx->pTable) ){
- if( (pWInfo->wctrlFlags & WHERE_SEEK_TABLE)!=0 ){
+ if( (pWInfo->wctrlFlags & WHERE_SEEK_TABLE) || (
+ (pWInfo->wctrlFlags & WHERE_SEEK_UNIQ_TABLE)
+ && (pWInfo->eOnePass==ONEPASS_SINGLE)
+ )){
iRowidReg = ++pParse->nMem;
sqlite3VdbeAddOp2(v, OP_IdxRowid, iIdxCur, iRowidReg);
sqlite3ExprCacheStore(pParse, iCur, -1, iRowidReg);