dan | 488b558 | 2021-11-16 13:36:50 +0000 | [diff] [blame] | 1 | # 2021 November 16 |
| 2 | # |
| 3 | # The author disclaims copyright to this source code. In place of |
| 4 | # a legal notice, here is a blessing: |
| 5 | # |
| 6 | # May you do good and not evil. |
| 7 | # May you find forgiveness for yourself and forgive others. |
| 8 | # May you share freely, never taking more than you give. |
| 9 | # |
| 10 | #*********************************************************************** |
| 11 | # This file implements regression tests for SQLite library. |
| 12 | # |
| 13 | |
| 14 | set testdir [file dirname $argv0] |
| 15 | source $testdir/tester.tcl |
| 16 | set testprefix alterfault |
| 17 | |
dan | c7b29b0 | 2021-11-22 16:43:53 +0000 | [diff] [blame] | 18 | # If SQLITE_OMIT_ALTERTABLE is defined, omit this file. |
| 19 | ifcapable !altertable { |
| 20 | finish_test |
| 21 | return |
| 22 | } |
| 23 | |
dan | 488b558 | 2021-11-16 13:36:50 +0000 | [diff] [blame] | 24 | do_execsql_test 1.0 { |
| 25 | CREATE TABLE t1(a); |
| 26 | } |
| 27 | faultsim_save_and_close |
| 28 | |
| 29 | do_faultsim_test 1.1 -faults oom* -prep { |
| 30 | faultsim_restore_and_reopen |
| 31 | } -body { |
| 32 | execsql { |
| 33 | ALTER TABLE t1 ADD COLUMN b CHECK (a!=1) |
| 34 | } |
| 35 | } -test { |
| 36 | faultsim_test_result {0 {}} |
| 37 | } |
| 38 | |
| 39 | |
| 40 | |
| 41 | finish_test |