1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Add tests. Deal issues surrounding aborting recovery from within the SQL callback, and avoiding the pending-byte page.

FossilOrigin-Name: 4e97dd31f5240d9231167ae172a5116426c42177a1ed3c5422b9d51b762d5a87
This commit is contained in:
dan
2022-09-13 18:08:24 +00:00
parent 5ca0b38605
commit 7985e05a97
12 changed files with 120 additions and 36 deletions

View File

@ -406,6 +406,11 @@ static int recoverExec(sqlite3_recover *p, sqlite3 *db, const char *zSql){
return p->errCode;
}
/*
** Bind the value pVal to parameter iBind of statement pStmt. Leave an
** error in the recover handle passed as the first argument if an error
** (e.g. an OOM) occurs.
*/
static void recoverBindValue(
sqlite3_recover *p,
sqlite3_stmt *pStmt,
@ -559,7 +564,7 @@ static void recoverGetPage(
return;
}else{
if( p->pGetPage==0 ){
pStmt = recoverPreparePrintf(
pStmt = p->pGetPage = recoverPreparePrintf(
p, p->dbIn, "SELECT data FROM sqlite_dbpage(%Q) WHERE pgno=?", p->zDb
);
}else{
@ -567,11 +572,12 @@ static void recoverGetPage(
}
if( pStmt ){
int rc = SQLITE_OK;
sqlite3_bind_int64(pStmt, 1, pgno);
if( SQLITE_ROW==sqlite3_step(pStmt) ){
sqlite3_result_value(pCtx, sqlite3_column_value(pStmt, 0));
}
p->pGetPage = recoverReset(p, pStmt);
recoverReset(p, pStmt);
}
}