mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-18 10:21:03 +03:00
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
This commit is contained in:
30
src/main.c
30
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user