mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Add the SQLITE_RECOVER_ROWIDS option. To specify that rowid values that are not also explicit INTEGER PRIMARY KEY values should be preserved.
FossilOrigin-Name: 69cc9aba56a196bbd159bd24868aa5ccc60bed0dc612d09ed8a3ae898f156809
This commit is contained in:
@ -82,6 +82,7 @@ static int testRecoverCmd(
|
||||
"testdb", /* 0 */
|
||||
"lostandfound", /* 1 */
|
||||
"freelistcorrupt", /* 2 */
|
||||
"rowids", /* 3 */
|
||||
0
|
||||
};
|
||||
int iOp = 0;
|
||||
@ -102,12 +103,20 @@ static int testRecoverCmd(
|
||||
break;
|
||||
case 2: {
|
||||
int iVal = 0;
|
||||
if( Tcl_GetIntFromObj(interp, objv[3], &iVal) ) return TCL_ERROR;
|
||||
if( Tcl_GetBooleanFromObj(interp, objv[3], &iVal) ) return TCL_ERROR;
|
||||
res = sqlite3_recover_config(pTest->p,
|
||||
SQLITE_RECOVER_FREELIST_CORRUPT, (void*)iVal
|
||||
);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
int iVal = 0;
|
||||
if( Tcl_GetBooleanFromObj(interp, objv[3], &iVal) ) return TCL_ERROR;
|
||||
res = sqlite3_recover_config(pTest->p,
|
||||
SQLITE_RECOVER_ROWIDS, (void*)iVal
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
Tcl_SetObjResult(interp, Tcl_NewIntObj(res));
|
||||
break;
|
||||
|
Reference in New Issue
Block a user