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

Remove the third argument from the sqlite3_open() API. (CVS 1540)

FossilOrigin-Name: 62e31f396cb6b49f542977e2fade78e11e371132
This commit is contained in:
danielk1977
2004-06-08 00:02:33 +00:00
parent 2ac3ee9787
commit 4f057f904a
9 changed files with 33 additions and 41 deletions

View File

@@ -1,5 +1,5 @@
C More\swork\son\swindows\slocking.\s\sFix\ssome\sproblems\swith\sunix\slocking.\s\sThere\nis\sstill\san\sassertion\sfailure\son\swindows\slocking\sin\sattach2.test.\s(CVS\s1539) C Remove\sthe\sthird\sargument\sfrom\sthe\ssqlite3_open()\sAPI.\s(CVS\s1540)
D 2004-06-07T16:27:46 D 2004-06-08T00:02:33
F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a F Makefile.in ab7b0d5118e2da97bac66be8684a1034e3500f5a
F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906
F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd
@@ -27,7 +27,7 @@ F src/attach.c e76e4590ec5dd389e5646b171881b5243a6ef391
F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79 F src/auth.c 5c2f0bea4729c98c2be3b69d6b466fc51448fe79
F src/btree.c edb38affc2e83f4299e49104cfe14e6570d8bd32 F src/btree.c edb38affc2e83f4299e49104cfe14e6570d8bd32
F src/btree.h 589427ac13bb544d298cd99726e2572a6fe4bdaa F src/btree.h 589427ac13bb544d298cd99726e2572a6fe4bdaa
F src/build.c e8043747608eba9ff293f4fcb52cbf958625d599 F src/build.c 83303494ccad0ed1cea24f73c7db1f2669820ccd
F src/date.c 8e6fa3173386fb29fdef012ee08a853c1e9908b2 F src/date.c 8e6fa3173386fb29fdef012ee08a853c1e9908b2
F src/delete.c b30f08250c9ed53a25a13c7c04599c1e8753992d F src/delete.c b30f08250c9ed53a25a13c7c04599c1e8753992d
F src/encode.c a876af473d1d636faa3dca51c7571f2e007eea37 F src/encode.c a876af473d1d636faa3dca51c7571f2e007eea37
@@ -37,7 +37,7 @@ F src/hash.c 440c2f8cb373ee1b4e13a0988489c7cd95d55b6f
F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb F src/hash.h 762d95f1e567664d1eafc1687de755626be962fb
F src/insert.c 4268d9e3959cc845ea243fb4ec7507269404dad9 F src/insert.c 4268d9e3959cc845ea243fb4ec7507269404dad9
F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f F src/legacy.c ad23746f15f67e34577621b1875f639c94839e1f
F src/main.c d34e173296473c9626f2560a0c86e694fc8e5a2b F src/main.c f94886765e71082d020c9d7b4d4f8645029ee7f6
F src/md5.c 4302e84ae516c616bb079c4e6d038c0addb33481 F src/md5.c 4302e84ae516c616bb079c4e6d038c0addb33481
F src/os.h a3a9c2df29acbff54aef742e85c302d23634019f F src/os.h a3a9c2df29acbff54aef742e85c302d23634019f
F src/os_common.h 12074232439f904b3805beeff1245bd1b5532994 F src/os_common.h 12074232439f904b3805beeff1245bd1b5532994
@@ -54,15 +54,15 @@ F src/pragma.c 54b4d67fa81fd38b911aa3325348dcae9ceac5a4
F src/printf.c 63b15f1ea9fe3daa066bb7430fd20d4a2d717dc8 F src/printf.c 63b15f1ea9fe3daa066bb7430fd20d4a2d717dc8
F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3 F src/random.c eff68e3f257e05e81eae6c4d50a51eb88beb4ff3
F src/select.c 0ac0adeb2ae15255ac4399d9ee1b0d25a266a676 F src/select.c 0ac0adeb2ae15255ac4399d9ee1b0d25a266a676
F src/shell.c 79af86d39b2149c7f16219fcbe636e7c2da9df8e F src/shell.c a70b41be0377ef74e85841025330ebbd34e0dd8b
F src/sqlite.h.in 4705697dd7213f322d59ffc69b48b8ac32b23373 F src/sqlite.h.in 577974e9a1b85815ccddfb5b858695b62000f595
F src/sqliteInt.h 845d2a3ffdb9a9050a1b55044d4856227b649b84 F src/sqliteInt.h 845d2a3ffdb9a9050a1b55044d4856227b649b84
F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2 F src/table.c af14284fa36c8d41f6829e3f2819dce07d3e2de2
F src/tclsqlite.c 3db6b868bd844bfb71720c8e573f4c9b0d536bd5 F src/tclsqlite.c c4d549ad9f5941288247759ead89d9632254fdc3
F src/test1.c b2498201826d83c8240a205954ecf8fc1b1d3554 F src/test1.c 416a37411f2ca7947e6509c5b6ddc6dd86a1204e
F src/test2.c ae18537d8a85e5028c955837797f9da461b908b8 F src/test2.c ae18537d8a85e5028c955837797f9da461b908b8
F src/test3.c beafd0ccf7b9ae784744be1b1e66ffe8f64c25da F src/test3.c beafd0ccf7b9ae784744be1b1e66ffe8f64c25da
F src/test4.c caf675e443460ec76b04d78e1688986c17c82cec F src/test4.c a921a69821fd30209589228e64f94e9f715b6fe2
F src/test5.c 44178ce85c3afd2004ab4eeb5cfd7487116ce366 F src/test5.c 44178ce85c3afd2004ab4eeb5cfd7487116ce366
F src/tokenize.c 183c5d7da11affab5d70d903d33409c8c0ce6c5b F src/tokenize.c 183c5d7da11affab5d70d903d33409c8c0ce6c5b
F src/trigger.c 532daca4972bbf1165bdeecf48d9949eee8c24c0 F src/trigger.c 532daca4972bbf1165bdeecf48d9949eee8c24c0
@@ -215,7 +215,7 @@ F www/support.tcl 1801397edd271cc39a2aadd54e701184b5181248
F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075 F www/tclsqlite.tcl 19191cf2a1010eaeff74c51d83fd5f5a4d899075
F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4 F www/whentouse.tcl a8335bce47cc2fddb07f19052cb0cb4d9129a8e4
P 31c1668dbc2b84438a5b78b0270f58b37b03791d P 0c2d169cf3c0f36972015c952a2b46cb9a333881
R 334ce43bb39f3c00215ba0df14f1b502 R ae36aa59d9c9bbd9dcea25dbefbbc5f3
U drh U danielk1977
Z f7c5a4dea192989af98a28345518141d Z 9bd0ddefb661cdb7cba70d74baa55d54

View File

@@ -1 +1 @@
0c2d169cf3c0f36972015c952a2b46cb9a333881 62e31f396cb6b49f542977e2fade78e11e371132

View File

@@ -23,7 +23,7 @@
** ROLLBACK ** ROLLBACK
** PRAGMA ** PRAGMA
** **
** $Id: build.c,v 1.208 2004/06/07 10:00:31 danielk1977 Exp $ ** $Id: build.c,v 1.209 2004/06/08 00:02:33 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include <ctype.h> #include <ctype.h>
@@ -662,10 +662,10 @@ void sqlite3AddColumn(Parse *pParse, Token *pName){
pCol->zName = z; pCol->zName = z;
/* If there is no type specified, columns have the default affinity /* If there is no type specified, columns have the default affinity
** 'NUMERIC'. If there is a type specified, then sqlite3AddColumnType() ** 'NONE'. If there is a type specified, then sqlite3AddColumnType() will
** will be called next to set pCol->affinity correctly. ** be called next to set pCol->affinity correctly.
*/ */
pCol->affinity = SQLITE_AFF_NUMERIC; pCol->affinity = SQLITE_AFF_NONE;
pCol->pColl = pParse->db->pDfltColl; pCol->pColl = pParse->db->pDfltColl;
p->nCol++; p->nCol++;
} }

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be ** other files are for internal use by SQLite and should not be
** accessed by users of the library. ** accessed by users of the library.
** **
** $Id: main.c,v 1.206 2004/06/07 07:52:18 danielk1977 Exp $ ** $Id: main.c,v 1.207 2004/06/08 00:02:34 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "os.h" #include "os.h"
@@ -1041,8 +1041,7 @@ opendb_out:
*/ */
int sqlite3_open( int sqlite3_open(
const char *zFilename, const char *zFilename,
sqlite3 **ppDb, sqlite3 **ppDb
const char **options
){ ){
return openDatabase(zFilename, ppDb); return openDatabase(zFilename, ppDb);
} }
@@ -1052,8 +1051,7 @@ int sqlite3_open(
*/ */
int sqlite3_open16( int sqlite3_open16(
const void *zFilename, const void *zFilename,
sqlite3 **ppDb, sqlite3 **ppDb
const char **options
){ ){
char *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */ char *zFilename8; /* zFilename encoded in UTF-8 instead of UTF-16 */
int rc; int rc;

View File

@@ -12,7 +12,7 @@
** This file contains code to implement the "sqlite" command line ** This file contains code to implement the "sqlite" command line
** utility for accessing SQLite databases. ** utility for accessing SQLite databases.
** **
** $Id: shell.c,v 1.102 2004/06/05 08:04:44 danielk1977 Exp $ ** $Id: shell.c,v 1.103 2004/06/08 00:02:34 danielk1977 Exp $
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -692,7 +692,7 @@ static void open_db(struct callback_data *p){
db = p->db = sqlite3_open_encrypted(p->zDbFilename, p->zKey, n, 0, &zErrMsg); db = p->db = sqlite3_open_encrypted(p->zDbFilename, p->zKey, n, 0, &zErrMsg);
assert(0); /* Encrypted databases are broken in SQLite 3 */ assert(0); /* Encrypted databases are broken in SQLite 3 */
#else #else
sqlite3_open(p->zDbFilename, &p->db, 0); sqlite3_open(p->zDbFilename, &p->db);
db = p->db; db = p->db;
#endif #endif
if( SQLITE_OK!=sqlite3_errcode(db) ){ if( SQLITE_OK!=sqlite3_errcode(db) ){

View File

@@ -12,7 +12,7 @@
** This header file defines the interface that the SQLite library ** This header file defines the interface that the SQLite library
** presents to client programs. ** presents to client programs.
** **
** @(#) $Id: sqlite.h.in,v 1.93 2004/06/06 09:44:04 danielk1977 Exp $ ** @(#) $Id: sqlite.h.in,v 1.94 2004/06/08 00:02:35 danielk1977 Exp $
*/ */
#ifndef _SQLITE_H_ #ifndef _SQLITE_H_
#define _SQLITE_H_ #define _SQLITE_H_
@@ -487,13 +487,11 @@ void *sqlite3_commit_hook(sqlite*, int(*)(void*), void*);
*/ */
int sqlite3_open( int sqlite3_open(
const char *filename, /* Database filename (UTF-8) */ const char *filename, /* Database filename (UTF-8) */
sqlite3 **ppDb, /* OUT: SQLite db handle */ sqlite3 **ppDb /* OUT: SQLite db handle */
const char **args /* Null terminated array of option strings */
); );
int sqlite3_open16( int sqlite3_open16(
const void *filename, /* Database filename (UTF-16) */ const void *filename, /* Database filename (UTF-16) */
sqlite3 **ppDb, /* OUT: SQLite db handle */ sqlite3 **ppDb /* OUT: SQLite db handle */
const char **args /* Null terminated array of option strings */
); );
/* /*

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** A TCL Interface to SQLite ** A TCL Interface to SQLite
** **
** $Id: tclsqlite.c,v 1.79 2004/06/02 00:41:09 drh Exp $ ** $Id: tclsqlite.c,v 1.80 2004/06/08 00:02:35 danielk1977 Exp $
*/ */
#ifndef NO_TCL /* Omit this whole file if TCL is unavailable */ #ifndef NO_TCL /* Omit this whole file if TCL is unavailable */
@@ -896,7 +896,6 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
const char *zArg; const char *zArg;
char *zErrMsg; char *zErrMsg;
const char *zFile; const char *zFile;
const char *zOpts[2] = {0, 0};
char zBuf[80]; char zBuf[80];
if( objc==2 ){ if( objc==2 ){
zArg = Tcl_GetStringFromObj(objv[1], 0); zArg = Tcl_GetStringFromObj(objv[1], 0);
@@ -949,10 +948,7 @@ static int DbMain(void *cd, Tcl_Interp *interp, int objc,Tcl_Obj *const*objv){
#ifdef SQLITE_HAS_CODEC #ifdef SQLITE_HAS_CODEC
p->db = sqlite3_open_encrypted(zFile, pKey, nKey, 0, &zErrMsg); p->db = sqlite3_open_encrypted(zFile, pKey, nKey, 0, &zErrMsg);
#else #else
if( objc>3 ){ sqlite3_open(zFile, &p->db);
zOpts[0] = Tcl_GetString(objv[3]);
}
sqlite3_open(zFile, &p->db, zOpts);
if( SQLITE_OK!=sqlite3_errcode(p->db) ){ if( SQLITE_OK!=sqlite3_errcode(p->db) ){
zErrMsg = strdup(sqlite3_errmsg(p->db)); zErrMsg = strdup(sqlite3_errmsg(p->db));
sqlite3_close(p->db); sqlite3_close(p->db);

View File

@@ -13,7 +13,7 @@
** is not included in the SQLite library. It is used for automated ** is not included in the SQLite library. It is used for automated
** testing of the SQLite library. ** testing of the SQLite library.
** **
** $Id: test1.c,v 1.70 2004/06/07 16:27:46 drh Exp $ ** $Id: test1.c,v 1.71 2004/06/08 00:02:35 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "tcl.h" #include "tcl.h"
@@ -1300,7 +1300,7 @@ static int test_open(
} }
zFilename = Tcl_GetString(objv[1]); zFilename = Tcl_GetString(objv[1]);
rc = sqlite3_open(zFilename, &db, 0); rc = sqlite3_open(zFilename, &db);
if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR; if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR;
Tcl_AppendResult(interp, zBuf, 0); Tcl_AppendResult(interp, zBuf, 0);
@@ -1328,7 +1328,7 @@ static int test_open16(
} }
zFilename = Tcl_GetByteArrayFromObj(objv[1], 0); zFilename = Tcl_GetByteArrayFromObj(objv[1], 0);
rc = sqlite3_open16(zFilename, &db, 0); rc = sqlite3_open16(zFilename, &db);
if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR; if( makePointerStr(interp, zBuf, db) ) return TCL_ERROR;
Tcl_AppendResult(interp, zBuf, 0); Tcl_AppendResult(interp, zBuf, 0);

View File

@@ -11,7 +11,7 @@
************************************************************************* *************************************************************************
** Code for testing the the SQLite library in a multithreaded environment. ** Code for testing the the SQLite library in a multithreaded environment.
** **
** $Id: test4.c,v 1.9 2004/05/31 19:34:33 drh Exp $ ** $Id: test4.c,v 1.10 2004/06/08 00:02:35 danielk1977 Exp $
*/ */
#include "sqliteInt.h" #include "sqliteInt.h"
#include "tcl.h" #include "tcl.h"
@@ -66,7 +66,7 @@ static void *thread_main(void *pArg){
if( p->db ){ if( p->db ){
sqlite3_close(p->db); sqlite3_close(p->db);
} }
sqlite3_open(p->zFilename, &p->db, 0); sqlite3_open(p->zFilename, &p->db);
if( SQLITE_OK!=sqlite3_errcode(p->db) ){ if( SQLITE_OK!=sqlite3_errcode(p->db) ){
p->zErr = strdup(sqlite3_errmsg(p->db)); p->zErr = strdup(sqlite3_errmsg(p->db));
sqlite3_close(p->db); sqlite3_close(p->db);