1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
# name: test/sql/storage/wal/wal_store_defaults.test
# description: Test storage of default values
# group: [wal]
require skip_reload
# load the DB from disk
load __TEST_DIR__/test_store_defaults.db
statement ok
PRAGMA disable_checkpoint_on_shutdown
statement ok
PRAGMA wal_autocheckpoint='1TB';
# create a table with a default value
statement ok
CREATE TABLE test (a INTEGER DEFAULT 1, b INTEGER);
statement ok
INSERT INTO test (b) VALUES (11)
query II
SELECT * FROM test ORDER BY b
----
1 11
# reload the database
restart
statement ok
PRAGMA disable_checkpoint_on_shutdown
statement ok
PRAGMA wal_autocheckpoint='1TB';
# verify that the table contains the correct contents
query II
SELECT * FROM test ORDER BY b
----
1 11
# append more entries
statement ok
INSERT INTO test (b) VALUES (12), (13)
# check that the default value was used in the INSERT
query II
SELECT * FROM test ORDER BY b
----
1 11
1 12
1 13
# reload and append one more time
restart
# append more entries
statement ok
INSERT INTO test (b) VALUES (14), (15)
# check that the default value was used in the INSERT
query II
SELECT * FROM test ORDER BY b
----
1 11
1 12
1 13
1 14
1 15
|