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

Remove the sqlite3BtreeFactor() wrapper routine. All modules now call

sqlite3BtreeOpen() directly.

FossilOrigin-Name: 0900e35348f4b9bf327d6ae2884c4ddbb6345d8d
This commit is contained in:
drh
2010-08-30 15:02:28 +00:00
parent 3b5a7a377c
commit 75c014c321
12 changed files with 82 additions and 103 deletions

View File

@@ -53,7 +53,7 @@ static sqlite3 sDb;
static int nRefSqlite3 = 0;
/*
** Usage: btree_open FILENAME NCACHE FLAGS
** Usage: btree_open FILENAME NCACHE
**
** Open a new database
*/
@@ -64,22 +64,21 @@ static int btree_open(
const char **argv /* Text of each argument */
){
Btree *pBt;
int rc, nCache, flags;
int rc, nCache;
char zBuf[100];
if( argc!=4 ){
if( argc!=3 ){
Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
" FILENAME NCACHE FLAGS\"", 0);
return TCL_ERROR;
}
if( Tcl_GetInt(interp, argv[2], &nCache) ) return TCL_ERROR;
if( Tcl_GetInt(interp, argv[3], &flags) ) return TCL_ERROR;
nRefSqlite3++;
if( nRefSqlite3==1 ){
sDb.pVfs = sqlite3_vfs_find(0);
sDb.mutex = sqlite3MutexAlloc(SQLITE_MUTEX_RECURSIVE);
sqlite3_mutex_enter(sDb.mutex);
}
rc = sqlite3BtreeOpen(argv[1], &sDb, &pBt, flags,
rc = sqlite3BtreeOpen(argv[1], &sDb, &pBt, 0,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_MAIN_DB);
if( rc!=SQLITE_OK ){
Tcl_AppendResult(interp, errorName(rc), 0);