From: drh Date: Fri, 22 Jan 2016 23:17:51 +0000 (+0000) Subject: In the TCL interface, if a database connection object was opened with X-Git-Tag: version-3.11.0~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=147ef3948622234303ef6d38c38e6ee9fe325928;p=thirdparty%2Fsqlite.git In the TCL interface, if a database connection object was opened with the -uri 1 option, then also honor URI filenames for the "backup" and "restore" commands. FossilOrigin-Name: a1c8116ced62d81f3f5ca26bbe0877e829d4cc56 --- diff --git a/manifest b/manifest index 2e197ef017..ffb98b2734 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C More\sMSVC\smakefile\scleanup. -D 2016-01-22T22:16:50.346 +C In\sthe\sTCL\sinterface,\sif\sa\sdatabase\sconnection\sobject\swas\sopened\swith\nthe\s-uri\s1\soption,\sthen\salso\shonor\sURI\sfilenames\sfor\sthe\s"backup"\sand\n"restore"\scommands. +D 2016-01-22T23:17:51.219 F Makefile.in 027c1603f255390c43a426671055a31c0a65fdb4 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc bf507c4168b28d0ba47ac29d53fd6244289f10b8 @@ -354,7 +354,7 @@ F src/sqliteInt.h 74e10a74116df0aec9d4a3e134f1a86cc34c2f14 F src/sqliteLimit.h 216557999cb45f2e3578ed53ebefe228d779cb46 F src/status.c 70912d7be68e9e2dbc4010c93d344af61d4c59ba F src/table.c 51b46b2a62d1b3a959633d593b89bab5e2c9155e -F src/tclsqlite.c 82979239a896992f9b78efec81cfda05d316a7d0 +F src/tclsqlite.c 94ef6e2794220c5b6064d4c78ec7169a8c5cc45d F src/test1.c 4f1b42699068b7806af3111786f5ad760c2c1ff7 F src/test2.c 5586f43fcd9a1be0830793cf9d354082c261b25b F src/test3.c a8887dabbbee3059af338f20d290084a63ed1b0f @@ -1419,7 +1419,7 @@ F tool/vdbe_profile.tcl 246d0da094856d72d2c12efec03250d71639d19f F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 48bd54594752d5be3337f12c72f28d2080cb630b F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c11c85fdb6514cae54bb44945cc197dcaba72307 -R 7e2bc2233b486c9642759e292a9803ed -U mistachkin -Z f537116bba79cbb015eb60c46b78af4d +P df22556fd75997111e52f96572da8379dfe948be +R 14f009751ec343de1132abf0a7bfa01f +U drh +Z 3618240e30f243f2df7ae3a3ace24b2d diff --git a/manifest.uuid b/manifest.uuid index 289f7591c2..5a178d2571 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -df22556fd75997111e52f96572da8379dfe948be \ No newline at end of file +a1c8116ced62d81f3f5ca26bbe0877e829d4cc56 \ No newline at end of file diff --git a/src/tclsqlite.c b/src/tclsqlite.c index 604e898265..aa913ca7c7 100644 --- a/src/tclsqlite.c +++ b/src/tclsqlite.c @@ -153,6 +153,7 @@ struct SqliteDb { IncrblobChannel *pIncrblob;/* Linked list of open incrblob channels */ int nStep, nSort, nIndex; /* Statistics for most recent operation */ int nTransaction; /* Number of nested [transaction] methods */ + int openFlags; /* Flags used to open. (SQLITE_OPEN_URI) */ #ifdef SQLITE_TEST int bLegacyPrepare; /* True to use sqlite3_prepare() */ #endif @@ -1750,7 +1751,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ Tcl_WrongNumArgs(interp, 2, objv, "?DATABASE? FILENAME"); return TCL_ERROR; } - rc = sqlite3_open(zDestFile, &pDest); + rc = sqlite3_open_v2(zDestFile, &pDest, + SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE| pDb->openFlags, 0); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "cannot open target database: ", sqlite3_errmsg(pDest), (char*)0); @@ -2613,7 +2615,8 @@ static int DbObjCmd(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ Tcl_WrongNumArgs(interp, 2, objv, "?DATABASE? FILENAME"); return TCL_ERROR; } - rc = sqlite3_open_v2(zSrcFile, &pSrc, SQLITE_OPEN_READONLY, 0); + rc = sqlite3_open_v2(zSrcFile, &pSrc, + SQLITE_OPEN_READONLY | pDb->openFlags, 0); if( rc!=SQLITE_OK ){ Tcl_AppendResult(interp, "cannot open source database: ", sqlite3_errmsg(pSrc), (char*)0); @@ -3088,6 +3091,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){ return TCL_ERROR; } p->maxStmt = NUM_PREPARED_STMTS; + p->openFlags = flags & SQLITE_OPEN_URI; p->interp = interp; zArg = Tcl_GetStringFromObj(objv[1], 0); if( DbUseNre() ){