1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-27 20:41:58 +03:00

Fix a crash in new ALTER TABLE code that could follow an OOM.

FossilOrigin-Name: 6f1f2a0a9cd75ca43b81cc325296b843ccefe6f8040da8f2e873f49928423f10
This commit is contained in:
dan
2021-06-11 12:14:58 +00:00
parent 6065686d9c
commit d03d3a9b74
4 changed files with 41 additions and 19 deletions

View File

@ -98,4 +98,25 @@ do_faultsim_test 4 -faults oom-* -prep {
faultsim_test_result {0 {}}
}
reset_db
do_execsql_test 5.0 {
CREATE TABLE rr(a, b);
CREATE VIEW vv AS SELECT * FROM (
WITH abc(d, e) AS (SELECT * FROM rr)
SELECT * FROM abc
);
} {}
faultsim_save_and_close
do_faultsim_test 5 -faults oom-* -prep {
faultsim_restore_and_reopen
execsql { SELECT * FROM sqlite_master }
} -body {
execsql {
ALTER TABLE rr RENAME TO c;
}
} -test {
faultsim_test_result {0 {}}
}
finish_test