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

Ensure that the recover extension properly escapes CR and NL characters in text mode. Also that it holds transactions open on both input and output databases for the duration of a recovery operation.

FossilOrigin-Name: 6cca8913e703635ad89415a60fc84000ac188d9df43f45594b8ad87facb91d54
This commit is contained in:
dan
2022-09-07 16:41:33 +00:00
parent 497b3e6a11
commit abb28667f1
4 changed files with 229 additions and 123 deletions

View File

@ -13,6 +13,7 @@
*/
#include "sqlite3recover.h"
#include "sqliteInt.h"
#include <tcl.h>
#include <assert.h>
@ -128,7 +129,7 @@ static int testRecoverCmd(
int iVal = 0;
if( Tcl_GetBooleanFromObj(interp, objv[3], &iVal) ) return TCL_ERROR;
res = sqlite3_recover_config(pTest->p,
SQLITE_RECOVER_FREELIST_CORRUPT, (void*)iVal
SQLITE_RECOVER_FREELIST_CORRUPT, SQLITE_INT_TO_PTR(iVal)
);
break;
}
@ -136,7 +137,7 @@ static int testRecoverCmd(
int iVal = 0;
if( Tcl_GetBooleanFromObj(interp, objv[3], &iVal) ) return TCL_ERROR;
res = sqlite3_recover_config(pTest->p,
SQLITE_RECOVER_ROWIDS, (void*)iVal
SQLITE_RECOVER_ROWIDS, SQLITE_INT_TO_PTR(iVal)
);
break;
}