diff options
author | drh <drh@noemail.net> | 2012-11-27 21:56:28 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2012-11-27 21:56:28 +0000 |
commit | 26cd614dad37c7cf2fdbc788a7517316554c702e (patch) | |
tree | dd0c18cc064eaffd9632b1c90ec49730c120939b /src/main.c | |
parent | afe5b83dcdee8faffce1b21b8c52a284311ce2a3 (diff) | |
parent | dac07e14c812cfb8fd8fda27f7a2de3894f240d9 (diff) | |
download | sqlite-26cd614dad37c7cf2fdbc788a7517316554c702e.tar.gz sqlite-26cd614dad37c7cf2fdbc788a7517316554c702e.zip |
Update the sessions branch to include the SQLLOG enhancement, the
SQLITE_IOERR_DELETE_NOENT fix, and a fix for the number-of-documents
bug in FTS4.
FossilOrigin-Name: ba8d08b67021a32fda069c18b7eb93523e6f0d1f
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c index 5778f8780..b8de24576 100644 --- a/src/main.c +++ b/src/main.c @@ -132,6 +132,13 @@ int sqlite3_initialize(void){ */ if( sqlite3GlobalConfig.isInit ) return SQLITE_OK; +#ifdef SQLITE_ENABLE_SQLLOG + { + extern void sqlite3_init_sqllog(void); + sqlite3_init_sqllog(); + } +#endif + /* Make sure the mutex subsystem is initialized. If unable to ** initialize the mutex subsystem, return early with the error. ** If the system is so sick that we are unable to allocate a mutex, @@ -480,6 +487,15 @@ int sqlite3_config(int op, ...){ break; } +#ifdef SQLITE_ENABLE_SQLLOG + case SQLITE_CONFIG_SQLLOG: { + typedef void(*SQLLOGFUNC_t)(void*, sqlite3*, const char*, int); + sqlite3GlobalConfig.xSqllog = va_arg(ap, SQLLOGFUNC_t); + sqlite3GlobalConfig.pSqllogArg = va_arg(ap, void *); + break; + } +#endif + default: { rc = SQLITE_ERROR; break; @@ -819,6 +835,13 @@ static int sqlite3Close(sqlite3 *db, int forceZombie){ return SQLITE_BUSY; } +#ifdef SQLITE_ENABLE_SQLLOG + if( sqlite3GlobalConfig.xSqllog ){ + /* Closing the handle. Fourth parameter is passed the value 2. */ + sqlite3GlobalConfig.xSqllog(sqlite3GlobalConfig.pSqllogArg, db, 0, 2); + } +#endif + /* Convert the connection into a zombie and then close it. */ db->magic = SQLITE_MAGIC_ZOMBIE; @@ -2472,6 +2495,13 @@ opendb_out: db->magic = SQLITE_MAGIC_SICK; } *ppDb = db; +#ifdef SQLITE_ENABLE_SQLLOG + if( sqlite3GlobalConfig.xSqllog ){ + /* Opening a db handle. Fourth parameter is passed 0. */ + void *pArg = sqlite3GlobalConfig.pSqllogArg; + sqlite3GlobalConfig.xSqllog(pArg, db, zFilename, 0); + } +#endif return sqlite3ApiExit(0, rc); } |