aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2019-01-22 13:45:48 +0000
committerdrh <drh@noemail.net>2019-01-22 13:45:48 +0000
commit247c1b4a0bef2dcefffb96ce228136c63564be75 (patch)
tree5723adf7bc4ed83c3f38d5df12509ef6372b3b0f /src
parent2c7a73eaea4a5c482fcdeb59d548df0464cd3d69 (diff)
downloadsqlite-247c1b4a0bef2dcefffb96ce228136c63564be75.tar.gz
sqlite-247c1b4a0bef2dcefffb96ce228136c63564be75.zip
Make sure cursors are opened on all indexes for an UPDATE OR REPLACE
regardless of whether or not the indexes are partial or contain columns that might need to be updated. FossilOrigin-Name: e148cdad35520e6684cfeba23b003f60b55f83a6bf621aff16be8aa5612cdcee
Diffstat (limited to 'src')
-rw-r--r--src/update.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/update.c b/src/update.c
index 0cf15a091..132837d44 100644
--- a/src/update.c
+++ b/src/update.c
@@ -354,6 +354,7 @@ void sqlite3Update(
** being updated. Fill in aRegIdx[] with a register number that will hold
** the key for accessing each index.
*/
+ if( onError==OE_Replace ) bReplace = 1;
for(j=0, pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext, j++){
int reg;
if( chngKey || hasFK>1 || pIdx==pPk
@@ -367,9 +368,7 @@ void sqlite3Update(
if( indexColumnIsBeingUpdated(pIdx, i, aXRef, chngRowid) ){
reg = ++pParse->nMem;
pParse->nMem += pIdx->nColumn;
- if( (onError==OE_Replace)
- || (onError==OE_Default && pIdx->onError==OE_Replace)
- ){
+ if( onError==OE_Default && pIdx->onError==OE_Replace ){
bReplace = 1;
}
break;