Merge the latest changes from trunk.

FossilOrigin-Name: 60105c2253d0b617037e975b0d0b729bcb59b950aa2c33d8891394ad45aabb69
This commit is contained in:
drh
2017-06-15 15:06:26 +00:00
23 changed files with 593 additions and 329 deletions
+8
View File
@@ -298,6 +298,14 @@ do_test 2.1.2 {
list [catch { rbu close } msg] $msg
} {1 {SQLITE_ERROR - cannot vacuum wal mode database}}
do_test 2.1.3 {
sqlite3rbu_vacuum rbu test.db state.db
rbu step
} {SQLITE_ERROR}
do_test 2.1.4 {
list [catch { rbu close_no_error } msg] $msg
} {1 SQLITE_ERROR}
reset_db
do_execsql_test 2.2.0 {
CREATE TABLE tx(a PRIMARY KEY, b BLOB);
+5 -1
View File
@@ -3787,7 +3787,11 @@ int sqlite3rbu_close(sqlite3rbu *p, char **pzErrmsg){
rbuEditErrmsg(p);
rc = p->rc;
*pzErrmsg = p->zErrmsg;
if( pzErrmsg ){
*pzErrmsg = p->zErrmsg;
}else{
sqlite3_free(p->zErrmsg);
}
sqlite3_free(p->zState);
sqlite3_free(p);
}else{
+4 -4
View File
@@ -420,10 +420,10 @@ int sqlite3rbu_savestate(sqlite3rbu *pRbu);
**
** If an error has already occurred as part of an sqlite3rbu_step()
** or sqlite3rbu_open() call, or if one occurs within this function, an
** SQLite error code is returned. Additionally, *pzErrmsg may be set to
** point to a buffer containing a utf-8 formatted English language error
** message. It is the responsibility of the caller to eventually free any
** such buffer using sqlite3_free().
** SQLite error code is returned. Additionally, if pzErrmsg is not NULL,
** *pzErrmsg may be set to point to a buffer containing a utf-8 formatted
** English language error message. It is the responsibility of the caller to
** eventually free any such buffer using sqlite3_free().
**
** Otherwise, if no error occurs, this function returns SQLITE_OK if the
** update has been partially applied, or SQLITE_DONE if it has been
+7 -1
View File
@@ -78,6 +78,7 @@ static int SQLITE_TCLAPI test_sqlite3rbu_cmd(
{"db", 3, "RBU"}, /* 6 */
{"state", 2, ""}, /* 7 */
{"progress", 2, ""}, /* 8 */
{"close_no_error", 2, ""}, /* 9 */
{0,0,0}
};
int iCmd;
@@ -102,11 +103,16 @@ static int SQLITE_TCLAPI test_sqlite3rbu_cmd(
break;
}
case 9: /* close_no_error */
case 1: /* close */ {
char *zErrmsg = 0;
int rc;
Tcl_DeleteCommand(interp, Tcl_GetString(objv[0]));
rc = sqlite3rbu_close(pRbu, &zErrmsg);
if( iCmd==1 ){
rc = sqlite3rbu_close(pRbu, &zErrmsg);
}else{
rc = sqlite3rbu_close(pRbu, 0);
}
if( rc==SQLITE_OK || rc==SQLITE_DONE ){
Tcl_SetObjResult(interp, Tcl_NewStringObj(sqlite3ErrName(rc), -1));
assert( zErrmsg==0 );
+1 -1
View File
@@ -16,6 +16,7 @@ if {![info exists testdir]} {
set testdir [file join [file dirname [info script]] .. .. test]
}
source $testdir/tester.tcl
ifcapable !session {finish_test; return}
set testprefix sessiondiff
set PROG [test_find_sqldiff]
@@ -111,4 +112,3 @@ do_changeset_test 1.2 {
}
finish_test