mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +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:
@ -684,6 +684,7 @@ do_test alter-8.2 {
|
||||
# alter-9.X - Special test: Make sure the sqlite_rename_column() and
|
||||
# rename_table() functions do not crash when handed bad input.
|
||||
#
|
||||
sqlite3_test_control SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 1
|
||||
do_test alter-9.1 {
|
||||
execsql {SELECT SQLITE_RENAME_COLUMN(0,0,0,0,0,0,0,0,0)}
|
||||
} {{}}
|
||||
@ -696,6 +697,14 @@ foreach {tn sql} {
|
||||
catch { execsql $sql }
|
||||
} 1
|
||||
}
|
||||
sqlite3_test_control SQLITE_TESTCTRL_INTERNAL_FUNCTIONS 0
|
||||
|
||||
# If the INTERNAL_FUNCTIONS test-control is disabled (which is the default),
|
||||
# then the sqlite_rename_table() SQL function is not accessible to ordinary SQL.
|
||||
#
|
||||
do_catchsql_test alter-9.3 {
|
||||
SELECT sqlite_rename_table(0,0,0,0,0,0,0);
|
||||
} {1 {no such function: sqlite_rename_table}}
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
# alter-10.X - Make sure ALTER TABLE works with multi-byte UTF-8 characters
|
||||
|
Reference in New Issue
Block a user