summaryrefslogtreecommitdiffstats
path: root/third_party/sqlite/src/test/alter2.test
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/sqlite/src/test/alter2.test')
-rw-r--r--third_party/sqlite/src/test/alter2.test23
1 files changed, 20 insertions, 3 deletions
diff --git a/third_party/sqlite/src/test/alter2.test b/third_party/sqlite/src/test/alter2.test
index 0ce023b..712960c 100644
--- a/third_party/sqlite/src/test/alter2.test
+++ b/third_party/sqlite/src/test/alter2.test
@@ -22,9 +22,10 @@ source $testdir/tester.tcl
# We have to have pragmas in order to do this test
ifcapable {!pragma} return
-# These tests do not work if there is a codec.
+# Do not use a codec for tests in this file, as the database file is
+# manipulated directly using tcl scripts. See proc [set_file_format].
#
-#if {[catch {sqlite3 -has_codec} r] || $r} return
+do_not_use_codec
# The file format change affects the way row-records stored in tables (but
# not indices) are interpreted. Before version 3.1.3, a row-record for a
@@ -72,6 +73,21 @@ proc alter_table {tbl sql {file_format 2}} {
set_file_format 2
}
+# Create bogus application-defined functions for functions used
+# internally by ALTER TABLE, to ensure that ALTER TABLE falls back
+# to the built-in functions.
+#
+proc failing_app_func {args} {error "bad function"}
+do_test alter2-1.0 {
+ db func substr failing_app_func
+ db func like failing_app_func
+ db func sqlite_rename_table failing_app_func
+ db func sqlite_rename_trigger failing_app_func
+ db func sqlite_rename_parent failing_app_func
+ catchsql {SELECT substr('abcdefg',1,3)}
+} {1 {bad function}}
+
+
#-----------------------------------------------------------------------
# Some basic tests to make sure short rows are handled.
#
@@ -233,7 +249,8 @@ ifcapable trigger {
do_test alter2-4.1 {
db close
set_file_format 5
- sqlite3 db test.db
+ catch { sqlite3 db test.db }
+ set {} {}
} {}
do_test alter2-4.2 {
# We have to run two queries here because the Tcl interface uses