diff options
author | drh <drh@noemail.net> | 2016-04-12 16:04:07 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2016-04-12 16:04:07 +0000 |
commit | 752b102e9ba06b39a81f80a19a9fd0026e77ae17 (patch) | |
tree | 1fd13b130da0e9156533af0a16d48548e8fdda3c /src/test1.c | |
parent | 70b8d6bbccc029d8c9a3ee9289b04f597acfd876 (diff) | |
parent | 745be369c799ab98c8c6798d92ec4f295bd54de9 (diff) | |
download | sqlite-752b102e9ba06b39a81f80a19a9fd0026e77ae17.tar.gz sqlite-752b102e9ba06b39a81f80a19a9fd0026e77ae17.zip |
Add the sqlite3_snapshot_cmp() interface (available only with
SQLITE_ENABLE_SNAPSHOT).
FossilOrigin-Name: 7e7289655185e7643ead6d685922528bc4d9e0ae
Diffstat (limited to 'src/test1.c')
-rw-r--r-- | src/test1.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test1.c b/src/test1.c index ead9bd47b..0c5af822c 100644 --- a/src/test1.c +++ b/src/test1.c @@ -2359,6 +2359,31 @@ static int test_snapshot_free( } #endif /* SQLITE_ENABLE_SNAPSHOT */ +#ifdef SQLITE_ENABLE_SNAPSHOT +/* +** Usage: sqlite3_snapshot_cmp SNAPSHOT1 SNAPSHOT2 +*/ +static int test_snapshot_cmp( + void * clientData, + Tcl_Interp *interp, + int objc, + Tcl_Obj *CONST objv[] +){ + int res; + sqlite3_snapshot *p1; + sqlite3_snapshot *p2; + if( objc!=3 ){ + Tcl_WrongNumArgs(interp, 1, objv, "SNAPSHOT1 SNAPSHOT2"); + return TCL_ERROR; + } + p1 = (sqlite3_snapshot*)sqlite3TestTextToPtr(Tcl_GetString(objv[1])); + p2 = (sqlite3_snapshot*)sqlite3TestTextToPtr(Tcl_GetString(objv[2])); + res = sqlite3_snapshot_cmp(p1, p2); + Tcl_SetObjResult(interp, Tcl_NewIntObj(res)); + return TCL_OK; +} +#endif /* SQLITE_ENABLE_SNAPSHOT */ + /* ** Usage: sqlite3_next_stmt DB STMT ** @@ -7249,6 +7274,7 @@ int Sqlitetest1_Init(Tcl_Interp *interp){ { "sqlite3_snapshot_get", test_snapshot_get, 0 }, { "sqlite3_snapshot_open", test_snapshot_open, 0 }, { "sqlite3_snapshot_free", test_snapshot_free, 0 }, + { "sqlite3_snapshot_cmp", test_snapshot_cmp, 0 }, #endif }; static int bitmask_size = sizeof(Bitmask)*8; |