diff options
author | drh <drh@noemail.net> | 2018-11-26 18:09:15 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2018-11-26 18:09:15 +0000 |
commit | eea8eb6d04f5eb2528f21d0585d603e4c1abe2ae (patch) | |
tree | 6504b0e99e092c6285f77292ec7796b0ce100f1a /src/main.c | |
parent | 49b269e0955b86db3205c11153928e093197fa38 (diff) | |
download | sqlite-eea8eb6d04f5eb2528f21d0585d603e4c1abe2ae.tar.gz sqlite-eea8eb6d04f5eb2528f21d0585d603e4c1abe2ae.zip |
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
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c index 1e5598393..46c83463c 100644 --- a/src/main.c +++ b/src/main.c @@ -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- |