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

Fix a bug that was preventing "PRAGMA temp_store=MEMORY" from working. (CVS 1887)

FossilOrigin-Name: bb55894521848b6a9d8b516a3c7eeb3482936d7e
This commit is contained in:
drh
2004-08-14 18:34:54 +00:00
parent 472cbf6b9e
commit 22ac46d15d
3 changed files with 13 additions and 18 deletions

View File

@@ -14,7 +14,7 @@
** other files are for internal use by SQLite and should not be
** accessed by users of the library.
**
** $Id: main.c,v 1.249 2004/08/01 00:10:45 drh Exp $
** $Id: main.c,v 1.250 2004/08/14 18:34:55 drh Exp $
*/
#include "sqliteInt.h"
#include "os.h"
@@ -817,7 +817,6 @@ int sqlite3BtreeFactory(
){
int btree_flags = 0;
int rc;
int useMem = 0;
assert( ppBtree != 0);
if( omitJournal ){
@@ -825,25 +824,21 @@ int sqlite3BtreeFactory(
}
if( zFilename==0 ){
#ifndef TEMP_STORE
# define TEMP_STORE 2
# define TEMP_STORE 1
#endif
#if TEMP_STORE==0
useMem = 0;
/* Do nothing */
#endif
#if TEMP_STORE==1
useMem = db->temp_store==2;
if( db->temp_store==2 ) zFilename = ":memory:";
#endif
#if TEMP_STORE==2
useMem = db->temp_store!=1;
if( db->temp_store!=1 ) zFilename = ":memory:";
#endif
#if TEMP_STORE==3
useMem = 1;
zFilename = ":memory:";
#endif
}
if( (zFilename && strcmp(zFilename, ":memory:")==0)
|| (zFilename==0 && useMem) ){
btree_flags |= BTREE_MEMORY;
}
rc = sqlite3BtreeOpen(zFilename, ppBtree, btree_flags);
if( rc==SQLITE_OK ){