OLD | NEW |
1 # 2006 June 10 | 1 # 2006 June 10 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
(...skipping 1136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1147 xSync \ | 1147 xSync \ |
1148 ] { | 1148 ] { |
1149 do_test vtab1-16.$tn { | 1149 do_test vtab1-16.$tn { |
1150 set echo_module_fail($method,t2) "the $method method has failed" | 1150 set echo_module_fail($method,t2) "the $method method has failed" |
1151 catchsql { INSERT INTO echo_t2 VALUES(7, 8, 9) } | 1151 catchsql { INSERT INTO echo_t2 VALUES(7, 8, 9) } |
1152 } "1 {echo-vtab-error: the $method method has failed}" | 1152 } "1 {echo-vtab-error: the $method method has failed}" |
1153 unset echo_module_fail($method,t2) | 1153 unset echo_module_fail($method,t2) |
1154 incr tn | 1154 incr tn |
1155 } | 1155 } |
1156 | 1156 |
1157 do_test vtab1-16.$tn { | 1157 ifcapable altertable { |
1158 set echo_module_fail(xRename,t2) "the xRename method has failed" | 1158 do_test vtab1-16.$tn { |
1159 catchsql { ALTER TABLE echo_t2 RENAME TO another_name } | 1159 set echo_module_fail(xRename,t2) "the xRename method has failed" |
1160 } "1 {echo-vtab-error: the xRename method has failed}" | 1160 catchsql { ALTER TABLE echo_t2 RENAME TO another_name } |
1161 unset echo_module_fail(xRename,t2) | 1161 } "1 {echo-vtab-error: the xRename method has failed}" |
1162 incr tn | 1162 unset echo_module_fail(xRename,t2) |
| 1163 incr tn |
| 1164 } |
| 1165 |
| 1166 # The following test case exposes an instance in sqlite3_declare_vtab() |
| 1167 # an error message was set using a call similar to sqlite3_mprintf(zErr), |
| 1168 # where zErr is an arbitrary string. This is no good if the string contains |
| 1169 # characters that can be mistaken for printf() formatting directives. |
| 1170 # |
| 1171 do_test vtab1-17.1 { |
| 1172 execsql { |
| 1173 PRAGMA writable_schema = 1; |
| 1174 INSERT INTO sqlite_master VALUES( |
| 1175 'table', 't3', 't3', 0, 'INSERT INTO "%s%s" VALUES(1)' |
| 1176 ); |
| 1177 } |
| 1178 catchsql { CREATE VIRTUAL TABLE t4 USING echo(t3); } |
| 1179 } {1 {vtable constructor failed: t4}} |
1163 | 1180 |
1164 unset -nocomplain echo_module_begin_fail | 1181 unset -nocomplain echo_module_begin_fail |
1165 finish_test | 1182 finish_test |
OLD | NEW |