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:
@@ -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. */
|
||||
|
Reference in New Issue
Block a user