1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Update the RBU vacuum code so that databases that use custom collation sequences can be vacuumed.

FossilOrigin-Name: 7dd48c10790a7b9c4165214399c261a0aa701297
This commit is contained in:
dan
2016-04-25 19:25:12 +00:00
parent b1ec87afdb
commit ae20690e2c
5 changed files with 220 additions and 106 deletions

View File

@ -20,8 +20,9 @@
#include <tcl.h>
#include <assert.h>
/* From main.c (apparently...) */
/* From main.c */
extern const char *sqlite3ErrName(int);
extern int sqlite3TestMakePointerStr(Tcl_Interp*, char*, void*);
void test_rbu_delta(sqlite3_context *pCtx, int nArg, sqlite3_value **apVal){
Tcl_Interp *interp = (Tcl_Interp*)sqlite3_user_data(pCtx);
@ -66,7 +67,8 @@ static int test_sqlite3rbu_cmd(
{"create_rbu_delta", 2, ""}, /* 2 */
{"savestate", 2, ""}, /* 3 */
{"dbMain_eval", 3, "SQL"}, /* 4 */
{"bp_progress", 2, ""}, /* 5 */
{"bp_progress", 2, ""}, /* 5 */
{"db", 3, "RBU"}, /* 6 */
{0,0,0}
};
int iCmd;
@ -149,6 +151,22 @@ static int test_sqlite3rbu_cmd(
break;
}
case 6: /* db */ {
int bArg;
if( Tcl_GetBooleanFromObj(interp, objv[2], &bArg) ){
ret = TCL_ERROR;
}else{
char zBuf[50];
sqlite3 *db = sqlite3rbu_db(pRbu, bArg);
if( sqlite3TestMakePointerStr(interp, zBuf, (void*)db) ){
ret = TCL_ERROR;
}else{
Tcl_SetResult(interp, zBuf, TCL_VOLATILE);
}
}
break;
}
default: /* seems unlikely */
assert( !"cannot happen" );
break;