1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Honor the SQLITE_OPEN_ flags passed into sqlite3_open_v2(). Some

test cases added but more are needed.  Ticket #2616. (CVS 4376)

FossilOrigin-Name: 020a2b10d408f51d4ef3211c5f701f5378fd4625
This commit is contained in:
drh
2007-09-03 15:19:34 +00:00
parent cd2543b6ae
commit 33f4e02af6
19 changed files with 170 additions and 85 deletions

View File

@@ -12,7 +12,7 @@
** A TCL Interface to SQLite. Append this file to sqlite3.c and
** compile the whole thing to build a TCL-enabled version of SQLite.
**
** $Id: tclsqlite.c,v 1.200 2007/08/31 14:31:45 drh Exp $
** $Id: tclsqlite.c,v 1.201 2007/09/03 15:19:35 drh Exp $
*/
#include "tcl.h"
#include <errno.h>
@@ -2306,7 +2306,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
int b;
if( Tcl_GetBooleanFromObj(interp, objv[i+1], &b) ) return TCL_ERROR;
if( b ){
flags &= ~SQLITE_OPEN_READWRITE;
flags &= ~(SQLITE_OPEN_READWRITE|SQLITE_OPEN_CREATE);
flags |= SQLITE_OPEN_READONLY;
}else{
flags &= ~SQLITE_OPEN_READONLY;
@@ -2315,7 +2315,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
}else if( strcmp(zArg, "-create")==0 ){
int b;
if( Tcl_GetBooleanFromObj(interp, objv[i+1], &b) ) return TCL_ERROR;
if( b ){
if( b && (flags & SQLITE_OPEN_READONLY)==0 ){
flags |= SQLITE_OPEN_CREATE;
}else{
flags &= ~SQLITE_OPEN_CREATE;