Index: src/main.c ================================================================== --- src/main.c +++ src/main.c @@ -338,14 +338,15 @@ } /* ** Close an existing SQLite database */ -int sqlite4_close(sqlite4 *db){ +int sqlite4_close(sqlite4 *db, unsigned int flags){ HashElem *i; /* Hash table iterator */ int j; + UNUSED_PARAMETER(flags); if( !db ){ return SQLITE4_OK; } if( !sqlite4SafetyCheckSickOrOk(db) ){ return SQLITE4_MISUSE_BKPT; @@ -1471,11 +1472,11 @@ sqlite4_mutex_leave(db->mutex); } rc = sqlite4_errcode(db); assert( db!=0 || rc==SQLITE4_NOMEM ); if( rc==SQLITE4_NOMEM ){ - sqlite4_close(db); + sqlite4_close(db, 0); db = 0; }else if( rc!=SQLITE4_OK ){ db->magic = SQLITE4_MAGIC_SICK; } *ppDb = db; Index: src/shell.c ================================================================== --- src/shell.c +++ src/shell.c @@ -2933,9 +2933,9 @@ rc = process_input(&data, stdin); } } set_table_name(&data, 0); if( data.db ){ - sqlite4_close(data.db); + sqlite4_close(data.db, 0); } return rc; } Index: src/sqlite.h.in ================================================================== --- src/sqlite.h.in +++ src/sqlite.h.in @@ -417,17 +417,20 @@ ** SQLITE4_BUSY. ** ** ^If [sqlite4_close()] is invoked while a transaction is open, ** the transaction is automatically rolled back. ** -** The C parameter to [sqlite4_close(C)] must be either a NULL +** The C parameter to [sqlite4_close(C,F)] must be either a NULL ** pointer or an [sqlite4] object pointer obtained ** from [sqlite4_open()] and not previously closed. ** ^Calling sqlite4_close() with a NULL pointer argument is a ** harmless no-op. +** +** The second parameter passed to sqlite4_close() is currently unused. It +** is reserved for future functionality. */ -int sqlite4_close(sqlite4 *); +int sqlite4_close(sqlite4 *, unsigned int flags); /* ** The type for a callback function. ** This is legacy and deprecated. It is included for historical ** compatibility and is not documented. Index: src/tclsqlite.c ================================================================== --- src/tclsqlite.c +++ src/tclsqlite.c @@ -227,11 +227,11 @@ ** deleted. */ static void DbDeleteCmd(void *db){ SqliteDb *pDb = (SqliteDb*)db; flushStmtCache(pDb); - sqlite4_close(pDb->db); + sqlite4_close(pDb->db, 0); while( pDb->pFunc ){ SqlFunc *pFunc = pDb->pFunc; pDb->pFunc = pFunc->pNext; Tcl_DecrRefCount(pFunc->pScript); Tcl_Free((char*)pFunc); @@ -2224,11 +2224,11 @@ zFile = Tcl_TranslateFileName(interp, zFile, &translatedFilename); sqlite4_open(0, zFile, &p->db, 0); Tcl_DStringFree(&translatedFilename); if( SQLITE4_OK!=sqlite4_errcode(p->db) ){ zErrMsg = sqlite4_mprintf(0, "%s", sqlite4_errmsg(p->db)); - sqlite4_close(p->db); + sqlite4_close(p->db, 0); p->db = 0; } #ifdef SQLITE4_TEST else{ extern int sqlite4test_install_test_functions(sqlite4*); Index: test/test_main.c ================================================================== --- test/test_main.c +++ test/test_main.c @@ -650,11 +650,11 @@ Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " FILENAME\"", 0); return TCL_ERROR; } if( getDbPointer(interp, argv[1], &db) ) return TCL_ERROR; - rc = sqlite4_close(db); + rc = sqlite4_close(db, 0); Tcl_SetResult(interp, (char *)t1ErrorName(rc), TCL_STATIC); return TCL_OK; } /* Index: test/test_misc1.c ================================================================== --- test/test_misc1.c +++ test/test_misc1.c @@ -44,16 +44,16 @@ goto error_out; } rc = sqlite4_create_collation(db, "collate", 456, 0, 0, 0, 0); if( rc!=SQLITE4_MISUSE ){ - sqlite4_close(db); + sqlite4_close(db, 0); zErrFunction = "sqlite4_create_collation"; goto error_out; } - sqlite4_close(db); + sqlite4_close(db, 0); return TCL_OK; error_out: Tcl_ResetResult(interp); Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0); @@ -126,11 +126,11 @@ rc = sqlite4_open(0, ":memory:", &db, 0); if( rc!=SQLITE4_OK ){ zErrFunction = "sqlite4_open"; goto error_out; } - sqlite4_close(db); + sqlite4_close(db, 0); rc = sqlite4_errcode(db); if( rc!=SQLITE4_MISUSE ){ zErrFunction = "sqlite4_errcode"; Index: test/test_thread0.c ================================================================== --- test/test_thread0.c +++ test/test_thread0.c @@ -59,16 +59,16 @@ ** The main loop for a thread. Threads use busy waiting. */ static void *thread_main(void *pArg){ Thread *p = (Thread*)pArg; if( p->db ){ - sqlite4_close(p->db); + sqlite4_close(p->db, 0); } sqlite4_open(0, p->zFilename, &p->db, 0); if( SQLITE4_OK!=sqlite4_errcode(p->db) ){ p->zErr = strdup(sqlite4_errmsg(p->db)); - sqlite4_close(p->db); + sqlite4_close(p->db, 0); p->db = 0; } p->pStmt = 0; p->completed = 1; while( p->opnum<=p->completed ) sched_yield(); @@ -84,11 +84,11 @@ if( p->pStmt ){ sqlite4_finalize(p->pStmt); p->pStmt = 0; } if( p->db ){ - sqlite4_close(p->db); + sqlite4_close(p->db, 0); p->db = 0; } if( p->zErr && p->zErr!=p->zStaticErr ){ sqlite4_free(0, p->zErr); p->zErr = 0;