1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-10 01:02:56 +03:00

Enhance UPSERT so that the UPDATE uses the same set of cursors as the INSERT.

FossilOrigin-Name: c37f39d18d41ae5ba6c4561d87cbbf71f3b6896b86cc5cff9cdf046b02dc521a
This commit is contained in:
drh
2018-04-20 13:18:51 +00:00
parent 2ac4e5cca9
commit 7fc3aba862
6 changed files with 26 additions and 18 deletions

View File

@@ -211,6 +211,11 @@ void sqlite3Update(
}
pParse->nTab++;
}
if( pUpsert ){
iDataCur = pUpsert->iDataCur;
iIdxCur = pUpsert->iIdxCur;
pParse->nTab = iBaseCur;
}
pTabList->a[0].iCursor = iDataCur;
/* Allocate space for aXRef[], aRegIdx[], and aToOpen[].
@@ -476,7 +481,7 @@ void sqlite3Update(
}
labelBreak = sqlite3VdbeMakeLabel(v);
if( !isView ){
if( !isView && pUpsert==0 ){
int addrOnce = 0;
/* Open every index that needs updating. */