1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Update some OOM tests of the ALTER TABLE command to account for an error message which may be returned if opening the temp db fails.

FossilOrigin-Name: 3409fd4150df059d7308f79fa3672a330af9cefe2ad9120c3da5ef1413921e96
This commit is contained in:
dan
2022-02-11 19:41:03 +00:00
parent eba21cd4be
commit 7b57aa3da9
4 changed files with 25 additions and 16 deletions

View File

@ -26,6 +26,11 @@ do_execsql_test 1.0 {
}
faultsim_save_and_close
set ::TMPDBERROR [list 1 \
{unable to open a temporary database file for storing temporary tables}
]
do_faultsim_test 1 -prep {
faultsim_restore_and_reopen
} -body {
@ -33,7 +38,7 @@ do_faultsim_test 1 -prep {
ALTER TABLE t1 RENAME abcd TO dcba
}
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
catch {db close}
@ -52,7 +57,7 @@ do_faultsim_test 2 -prep {
ALTER TABLE t1 RENAME abcd TO dcba
}
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
@ -70,7 +75,7 @@ do_faultsim_test 3 -prep {
ALTER TABLE t1 RENAME abcd TO dcba
}
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
reset_db
@ -95,7 +100,7 @@ do_faultsim_test 4 -faults oom-* -prep {
ALTER TABLE rr RENAME a TO c;
}
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
reset_db
@ -116,7 +121,7 @@ do_faultsim_test 5 -faults oom-* -prep {
ALTER TABLE rr RENAME TO c;
}
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
finish_test

View File

@ -21,6 +21,10 @@ ifcapable !altertable {
return
}
set ::TMPDBERROR [list 1 \
{unable to open a temporary database file for storing temporary tables}
]
do_execsql_test 1.0 {
CREATE TABLE x1(
one, two, three, PRIMARY KEY(one),
@ -40,7 +44,7 @@ do_faultsim_test 1 -prep {
} -body {
execsql { ALTER TABLE t1 DROP COLUMN c }
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
#-------------------------------------------------------------------------
@ -72,7 +76,7 @@ do_faultsim_test 2.2 -prep {
ALTER TABLE t2 RENAME TO t2x;
}
} -test {
faultsim_test_result {0 {}}
faultsim_test_result {0 {}} $::TMPDBERROR
}
finish_test