1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Merge the latest enhancements from trunk.

FossilOrigin-Name: bd57e6d923d3b04f0a07aaf18bf389d2b2b7efc7c57e8cb37e6ef910662d8397
This commit is contained in:
drh
2020-01-02 21:41:59 +00:00
35 changed files with 544 additions and 166 deletions

View File

@@ -3347,6 +3347,13 @@ static int openDatabase(
}
#endif
#ifdef SQLITE_ENABLE_INTERNAL_FUNCTIONS
/* Testing use only!!! The -DSQLITE_ENABLE_INTERNAL_FUNCTIONS=1 compile-time
** option gives access to internal functions by default.
** Testing use only!!! */
db->mDbFlags |= DBFLAG_InternalFunc;
#endif
/* -DSQLITE_DEFAULT_LOCKING_MODE=1 makes EXCLUSIVE the default locking
** mode. -DSQLITE_DEFAULT_LOCKING_MODE=0 make NORMAL the default locking
** mode. Doing nothing at all also makes NORMAL the default.
@@ -4079,15 +4086,14 @@ int sqlite3_test_control(int op, ...){
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_INTERNAL_FUNCS, int onoff);
/* sqlite3_test_control(SQLITE_TESTCTRL_INTERNAL_FUNCTIONS, sqlite3*);
**
** If parameter onoff is non-zero, internal-use-only SQL functions
** are visible to ordinary SQL. This is useful for testing but is
** unsafe because invalid parameters to those internal-use-only functions
** can result in crashes or segfaults.
** Toggle the ability to use internal functions on or off for
** the database connection given in the argument.
*/
case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: {
sqlite3GlobalConfig.bInternalFunctions = va_arg(ap, int);
sqlite3 *db = va_arg(ap, sqlite3*);
db->mDbFlags ^= DBFLAG_InternalFunc;
break;
}