mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-10 01:02:56 +03:00
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
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user