Sync the vt02.c test virtual table with TH3, in order to pull in the fix

for long delays when there are huge OFFSET values.

FossilOrigin-Name: 49ba030080dd00b4fdf788fd3da057b333e705fa0fe37d653e2461bf96ca3785
This commit is contained in:
drh
2023-04-10 13:20:51 +00:00
parent d27c18818c
commit 8346f8dacc
3 changed files with 9 additions and 15 deletions
+2 -8
View File
@@ -177,8 +177,6 @@
#include <assert.h>
#endif
#ifndef SQLITE_OMIT_VIRTUALTABLE
/* Forward declarations */
typedef struct vt02_vtab vt02_vtab;
typedef struct vt02_cur vt02_cur;
@@ -381,7 +379,7 @@ static int vt02Filter(
sqlite3_int64 v;
pVal = 0;
if( sqlite3_vtab_in_first(0, &pVal)!=SQLITE_MISUSE
|| sqlite3_vtab_in_first(argv[iArg], &pVal)!=SQLITE_MISUSE
|| sqlite3_vtab_in_first(argv[iArg], &pVal)!=SQLITE_ERROR
){
vt02ErrMsg(pCursor->pVtab,
"unexpected success from sqlite3_vtab_in_first()");
@@ -420,7 +418,7 @@ static int vt02Filter(
}
if( bUseOffset ){
int nSkip = sqlite3_value_int(argv[iArg]);
while( nSkip-- > 0 ) vt02Next(pCursor);
while( nSkip-- > 0 && pCur->i<pCur->iEof ) vt02Next(pCursor);
}
return SQLITE_OK;
@@ -1001,10 +999,6 @@ static void vt02CoreInit(sqlite3 *db){
sqlite3_create_module(db, "vt02pkabcd", &vt02Module, (void*)zPkABCDSchema);
}
#else
# define vt02CoreInit(db)
#endif /* ifndef SQLITE_OMIT_VIRTUALTABLE */
#ifdef TH3_VERSION
static void vt02_init(th3state *p, int iDb, char *zArg){
vt02CoreInit(th3dbPointer(p, iDb));