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

Do not allow direct access to internal-use SQL functions such as

sqlite_rename_column() and sqlite3_rename_table() except when the
new SQLITE_TESTCTRL_INTERNAL_FUNCTIONS flag is set.

FossilOrigin-Name: 6e1330545e7b74fe5f1f20751a3425e2788441485fc07fcb7626e448c72027ce
This commit is contained in:
drh
2018-11-26 18:09:15 +00:00
parent 49b269e095
commit eea8eb6d04
18 changed files with 108 additions and 47 deletions

View File

@@ -3953,15 +3953,26 @@ int sqlite3_test_control(int op, ...){
/* sqlite3_test_control(SQLITE_TESTCTRL_LOCALTIME_FAULT, int onoff);
**
** If parameter onoff is non-zero, configure the wrappers so that all
** subsequent calls to localtime() and variants fail. If onoff is zero,
** undo this setting.
** If parameter onoff is non-zero, subsequent calls to localtime()
** and its variants fail. If onoff is zero, undo this setting.
*/
case SQLITE_TESTCTRL_LOCALTIME_FAULT: {
sqlite3GlobalConfig.bLocaltimeFault = va_arg(ap, int);
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_INTERNAL_FUNCS, int onoff);
**
** 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.
*/
case SQLITE_TESTCTRL_INTERNAL_FUNCTIONS: {
sqlite3GlobalConfig.bInternalFunctions = va_arg(ap, int);
break;
}
/* sqlite3_test_control(SQLITE_TESTCTRL_NEVER_CORRUPT, int);
**
** Set or clear a flag that indicates that the database file is always well-