mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-08 14:02:16 +03:00
Move the implementation of sqlite3_enable_shared_cache from btree.c to main.c. (CVS 2902)
FossilOrigin-Name: 4f2ec95283f1ae0a28b2f9ce0afc5a7203de87fb
This commit is contained in:
16
manifest
16
manifest
@@ -1,5 +1,5 @@
|
||||
C Fix\sa\sproblem\swith\sshared-schemas\sand\stemp\striggers.\s(CVS\s2901)
|
||||
D 2006-01-10T12:31:40
|
||||
C Move\sthe\simplementation\sof\ssqlite3_enable_shared_cache\sfrom\sbtree.c\sto\smain.c.\s(CVS\s2902)
|
||||
D 2006-01-10T13:58:48
|
||||
F Makefile.in ab3ffd8d469cef4477257169b82810030a6bb967
|
||||
F Makefile.linux-gcc aee18d8a05546dcf1888bd4547e442008a49a092
|
||||
F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
|
||||
@@ -34,7 +34,7 @@ F src/alter.c d0dd079b9ef0d551ff4a4ce09ee270c07b307bbb
|
||||
F src/analyze.c ed87abad3f6f60e1bd5308ed6ff6e0fa396db52b
|
||||
F src/attach.c 8438a2808f89c01cfd472e676a27d771ac4405aa
|
||||
F src/auth.c cdec356a5cd8b217c346f816c5912221537fe87f
|
||||
F src/btree.c 5e5dff4a667d93d49925d38de2d451a5bd1eabfd
|
||||
F src/btree.c 874eaba6dec1660c7c917d5afc790f69de82cf2e
|
||||
F src/btree.h 5663c4f43e8521546ccebc8fc95acb013b8f3184
|
||||
F src/build.c 97997d435acfb9406f776f14931c16559bd534e5
|
||||
F src/callback.c 1c2b78a210fda18cdd4d0b604ed41bf0e1f5125c
|
||||
@@ -48,7 +48,7 @@ F src/hash.c 8747cf51d12de46512880dfcf1b68b4e24072863
|
||||
F src/hash.h 1b0c445e1c89ff2aaad9b4605ba61375af001e84
|
||||
F src/insert.c 16610475976dc9b25d231338e283dd4b4362a430
|
||||
F src/legacy.c f651ccd3700f99fa05766ac53506bf9a0694761b
|
||||
F src/main.c eb4ba0a5068b7fa086e04338eb78997e9e5c4941
|
||||
F src/main.c 3fe4b606db7d269d7a57c7b51ab3d9ff488e4b98
|
||||
F src/md5.c c5fdfa5c2593eaee2e32a5ce6c6927c986eaf217
|
||||
F src/os.c 1d1a61cdf150e9f9520a3bc787c8465148ea2e78
|
||||
F src/os.h 8710c0068f3386a73a37f8ad242b92c7580464df
|
||||
@@ -340,7 +340,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
|
||||
F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
|
||||
F www/version3.tcl a99cf5f6d8bd4d5537584a2b342f0fb9fa601d8b
|
||||
F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
|
||||
P bd02a6faefa3602d0b93d54bc57809a2222d5903
|
||||
R b3a5083bd04048926b4b9deff43305a7
|
||||
U danielk1977
|
||||
Z 4a23a33bfc9bd6ad6c92d55f05958140
|
||||
P 9c18a1ce1e7ff6a02eb0f9ce344cab9660819740
|
||||
R d6f71e8344cce361f5d74f812339b551
|
||||
U drh
|
||||
Z a1174a32567e13b6cc8e755afde6cc38
|
||||
|
@@ -1 +1 @@
|
||||
9c18a1ce1e7ff6a02eb0f9ce344cab9660819740
|
||||
4f2ec95283f1ae0a28b2f9ce0afc5a7203de87fb
|
24
src/btree.c
24
src/btree.c
@@ -9,7 +9,7 @@
|
||||
** May you share freely, never taking more than you give.
|
||||
**
|
||||
*************************************************************************
|
||||
** $Id: btree.c,v 1.288 2006/01/09 09:59:49 danielk1977 Exp $
|
||||
** $Id: btree.c,v 1.289 2006/01/10 13:58:48 drh Exp $
|
||||
**
|
||||
** This file implements a external (disk-based) database using BTrees.
|
||||
** For a detailed discussion of BTrees, refer to
|
||||
@@ -6498,25 +6498,3 @@ int sqlite3BtreeLockTable(Btree *p, int iTab, u8 isWriteLock){
|
||||
#endif
|
||||
return rc;
|
||||
}
|
||||
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
/*
|
||||
** Enable the shared pager and schema features.
|
||||
*/
|
||||
int sqlite3_enable_shared_cache(int enable){
|
||||
ThreadData *pTd = sqlite3ThreadData();
|
||||
|
||||
/* It is only legal to call sqlite3_enable_shared_cache() when there
|
||||
** are no currently open b-trees that were opened by the calling thread.
|
||||
** This condition is only easy to detect if the shared-cache were
|
||||
** previously enabled (and is being disabled).
|
||||
*/
|
||||
if( pTd->pBtree && !enable ){
|
||||
assert( pTd->useSharedData );
|
||||
return SQLITE_MISUSE;
|
||||
}
|
||||
|
||||
pTd->useSharedData = enable;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#endif
|
||||
|
29
src/main.c
29
src/main.c
@@ -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.321 2006/01/10 07:14:24 danielk1977 Exp $
|
||||
** $Id: main.c,v 1.322 2006/01/10 13:58:48 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include "os.h"
|
||||
@@ -1053,3 +1053,30 @@ int sqlite3Corrupt(void){
|
||||
return SQLITE_CORRUPT;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef SQLITE_OMIT_SHARED_CACHE
|
||||
/*
|
||||
** Enable or disable the shared pager and schema features for the
|
||||
** current thread.
|
||||
**
|
||||
** This routine should only be called when there are no open
|
||||
** database connections.
|
||||
*/
|
||||
int sqlite3_enable_shared_cache(int enable){
|
||||
ThreadData *pTd = sqlite3ThreadData();
|
||||
|
||||
/* It is only legal to call sqlite3_enable_shared_cache() when there
|
||||
** are no currently open b-trees that were opened by the calling thread.
|
||||
** This condition is only easy to detect if the shared-cache were
|
||||
** previously enabled (and is being disabled).
|
||||
*/
|
||||
if( pTd->pBtree && !enable ){
|
||||
assert( pTd->useSharedData );
|
||||
return SQLITE_MISUSE;
|
||||
}
|
||||
|
||||
pTd->useSharedData = enable;
|
||||
return SQLITE_OK;
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user