diff options
author | drh <drh@noemail.net> | 2015-06-16 16:39:01 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2015-06-16 16:39:01 +0000 |
commit | 0dd5cdaea5594977a58cd4de136c135465b78864 (patch) | |
tree | eb0783412d196c2e4222742f15cc1978d715ff71 /test/table.test | |
parent | 07d694c750d16e55d0c5866dbea3d8a1cf374f76 (diff) | |
download | sqlite-0dd5cdaea5594977a58cd4de136c135465b78864.tar.gz sqlite-0dd5cdaea5594977a58cd4de136c135465b78864.zip |
Ensure that the CREATE TABLE AS statement correctly undoes partial changes
to the sqlite_master table if the SELECT on the right-hand side aborts with
an error. Fix for ticket [873cae2b6e25b]
FossilOrigin-Name: 400e025e7c61efab71b891743c07a0862e5bb934
Diffstat (limited to 'test/table.test')
-rw-r--r-- | test/table.test | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/table.test b/test/table.test index faa9712bf..2aec6473e 100644 --- a/test/table.test +++ b/test/table.test @@ -808,4 +808,20 @@ do_execsql_test table-17.1 { SELECT p, q, '|' FROM t3 ORDER BY p; } {1 1 | 2 2 |} +# 2015-06-16 +# Ticket [https://www.sqlite.org/src/tktview/873cae2b6e25b1991ce5e9b782f9cd0409b96063] +# Make sure a CREATE TABLE AS statement correctly rolls back partial changes to the +# sqlite_master table when the SELECT on the right-hand side aborts. +# +do_catchsql_test table-18.1 { + DROP TABLE IF EXISTS t1; + BEGIN; + CREATE TABLE t1 AS SELECT zeroblob(2e20); +} {1 {string or blob too big}} +do_execsql_test table-18.2 { + COMMIT; + PRAGMA integrity_check; +} {ok} + + finish_test |