mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Ensure an sqlite_dbdata cursor is properly reset before being used again, even if it has already encountered database corruption.
FossilOrigin-Name: 3210e1ca4d0efedf9710c97abd050ba10d3af98cb1f029c26daa84daf42fbc7e
This commit is contained in:
@ -325,6 +325,7 @@ static void dbdataResetCursor(DbdataCursor *pCsr){
|
||||
sqlite3_free(pCsr->aPage);
|
||||
dbdataBufferFree(&pCsr->rec);
|
||||
pCsr->aPage = 0;
|
||||
pCsr->nRec = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
@ -596,6 +597,7 @@ static int dbdataNext(sqlite3_vtab_cursor *pCursor){
|
||||
}
|
||||
}else{
|
||||
/* If there is no record loaded, load it now. */
|
||||
assert( pCsr->rec.aBuf!=0 || pCsr->nRec==0 );
|
||||
if( pCsr->nRec==0 ){
|
||||
int bHasRowid = 0;
|
||||
int nPointer = 0;
|
||||
|
Reference in New Issue
Block a user