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

Merge the 3.24.0 changes plus a few subsequent enhancements.

FossilOrigin-Name: be7004a971a174ae5c862cb3fa29f3586882d9ed1630d3e50e686d7310ccbc91
This commit is contained in:
drh
2018-06-06 17:12:46 +00:00
63 changed files with 1358 additions and 447 deletions

View File

@@ -856,7 +856,7 @@ static void updateVirtualTable(
int regRowid; /* Register for ephem table rowid */
int iCsr = pSrc->a[0].iCursor; /* Cursor used for virtual table scan */
int aDummy[2]; /* Unused arg for sqlite3WhereOkOnePass() */
int bOnePass; /* True to use onepass strategy */
int eOnePass; /* True to use onepass strategy */
int addr; /* Address of OP_OpenEphemeral */
/* Allocate nArg registers in which to gather the arguments for VUpdate. Then
@@ -901,12 +901,16 @@ static void updateVirtualTable(
sqlite3VdbeAddOp2(v, OP_SCopy, regArg+2+iPk, regArg+1);
}
bOnePass = sqlite3WhereOkOnePass(pWInfo, aDummy);
eOnePass = sqlite3WhereOkOnePass(pWInfo, aDummy);
if( bOnePass ){
/* There is no ONEPASS_MULTI on virtual tables */
assert( eOnePass==ONEPASS_OFF || eOnePass==ONEPASS_SINGLE );
if( eOnePass ){
/* If using the onepass strategy, no-op out the OP_OpenEphemeral coded
** above. */
sqlite3VdbeChangeToNoop(v, addr);
sqlite3VdbeAddOp1(v, OP_Close, iCsr);
}else{
/* Create a record from the argument register contents and insert it into
** the ephemeral table. */
@@ -922,7 +926,7 @@ static void updateVirtualTable(
}
if( bOnePass==0 ){
if( eOnePass==ONEPASS_OFF ){
/* End the virtual table scan */
sqlite3WhereEnd(pWInfo);
@@ -942,7 +946,7 @@ static void updateVirtualTable(
/* End of the ephemeral table scan. Or, if using the onepass strategy,
** jump to here if the scan visited zero rows. */
if( bOnePass==0 ){
if( eOnePass==ONEPASS_OFF ){
sqlite3VdbeAddOp2(v, OP_Next, ephemTab, addr+1); VdbeCoverage(v);
sqlite3VdbeJumpHere(v, addr);
sqlite3VdbeAddOp2(v, OP_Close, ephemTab, 0);