|
1 | 1 | statement ok |
2 | | -DROP DATABASE IF EXISTS db1 |
| 2 | +create or replace database ee_vacuum_03_0018; |
3 | 3 |
|
4 | 4 | statement ok |
5 | | -CREATE DATABASE db1 |
| 5 | +use ee_vacuum_03_0018; |
6 | 6 |
|
7 | 7 | statement ok |
8 | | -USE db1 |
| 8 | +CREATE OR REPLACE TRANSIENT TABLE test_tbl(a int); |
| 9 | + |
| 10 | +#################################################################################### |
| 11 | +# transient tables should ignore the data_retention_num_snapshots_to_keep settings # |
| 12 | +#################################################################################### |
| 13 | + |
| 14 | +statement ok |
| 15 | +set data_retention_num_snapshots_to_keep = 20; |
| 16 | + |
| 17 | +statement ok |
| 18 | +INSERT INTO test_tbl VALUES(1) |
| 19 | + |
| 20 | +statement ok |
| 21 | +INSERT INTO test_tbl VALUES(2) |
| 22 | + |
| 23 | +statement ok |
| 24 | +INSERT INTO test_tbl VALUES(3) |
| 25 | + |
| 26 | +query I |
| 27 | +select * from test_tbl order by a |
| 28 | +---- |
| 29 | +1 |
| 30 | +2 |
| 31 | +3 |
| 32 | + |
| 33 | +query B |
| 34 | +select count(*)=1 from fuse_snapshot('ee_vacuum_03_0018', 'test_tbl') |
| 35 | +---- |
| 36 | +1 |
| 37 | + |
| 38 | +############################################################################### |
| 39 | +# test data_retention_time_in_days setting does not affect transient tables # |
| 40 | +############################################################################### |
| 41 | + |
| 42 | +# reset data_retention_num_snapshots_to_keep to default value |
| 43 | +statement ok |
| 44 | +unset data_retention_num_snapshots_to_keep |
| 45 | + |
| 46 | +statement ok |
| 47 | +CREATE OR REPLACE TRANSIENT TABLE test_tbl(a int); |
| 48 | + |
| 49 | +# transient tables should ignore the data_retention_time_in_days settings |
| 50 | +statement ok |
| 51 | +set data_retention_time_in_days = 20; |
| 52 | + |
| 53 | +statement ok |
| 54 | +INSERT INTO test_tbl VALUES(1) |
| 55 | + |
| 56 | +statement ok |
| 57 | +INSERT INTO test_tbl VALUES(2) |
| 58 | + |
| 59 | +statement ok |
| 60 | +INSERT INTO test_tbl VALUES(3) |
| 61 | + |
| 62 | +query I |
| 63 | +select * from test_tbl order by a |
| 64 | +---- |
| 65 | +1 |
| 66 | +2 |
| 67 | +3 |
| 68 | + |
| 69 | +query B |
| 70 | +select count(*)=1 from fuse_snapshot('ee_vacuum_03_0018', 'test_tbl') |
| 71 | +---- |
| 72 | +1 |
| 73 | + |
| 74 | +###################################################################################### |
| 75 | +# test table option data_retention_period_in_hours does not affect transient tables # |
| 76 | +###################################################################################### |
| 77 | + |
| 78 | +# reset data_retention_time_in_days to default value |
| 79 | +statement ok |
| 80 | +unset data_retention_time_in_days; |
| 81 | + |
| 82 | +# transient tables should ignore the data_retention_period_in_hours table option |
| 83 | +statement ok |
| 84 | +CREATE OR REPLACE TRANSIENT TABLE test_tbl(a int) data_retention_period_in_hours = 1; |
9 | 85 |
|
10 | 86 | statement ok |
11 | | -CREATE TRANSIENT TABLE IF NOT EXISTS t09_0016(a int) |
| 87 | +unset data_retention_num_snapshots_to_keep; |
12 | 88 |
|
13 | 89 | statement ok |
14 | | -INSERT INTO t09_0016 VALUES(1) |
| 90 | +INSERT INTO test_tbl VALUES(1) |
15 | 91 |
|
16 | 92 | statement ok |
17 | | -INSERT INTO t09_0016 VALUES(2) |
| 93 | +INSERT INTO test_tbl VALUES(2) |
18 | 94 |
|
19 | 95 | statement ok |
20 | | -INSERT INTO t09_0016 VALUES(3) |
| 96 | +INSERT INTO test_tbl VALUES(3) |
21 | 97 |
|
22 | 98 | query I |
23 | | -select * from t09_0016 order by a |
| 99 | +select * from test_tbl order by a |
24 | 100 | ---- |
25 | 101 | 1 |
26 | 102 | 2 |
27 | 103 | 3 |
28 | 104 |
|
29 | 105 | query B |
30 | | -select count(*)=1 from fuse_snapshot('db1', 't09_0016') |
| 106 | +select count(*)=1 from fuse_snapshot('ee_vacuum_03_0018', 'test_tbl') |
31 | 107 | ---- |
32 | 108 | 1 |
33 | 109 |
|
| 110 | +###################################################################################### |
| 111 | +# test table option data_retention_num_snapshots_to_keep does not affect transient tables # |
| 112 | +###################################################################################### |
34 | 113 |
|
| 114 | +# transient tables should ignore the data_retention_num_snapshots_to_keep table option |
| 115 | +statement ok |
| 116 | +CREATE OR REPLACE TRANSIENT TABLE test_tbl(a int) data_retention_num_snapshots_to_keep = 100; |
| 117 | + |
| 118 | +statement ok |
| 119 | +INSERT INTO test_tbl VALUES(1) |
35 | 120 |
|
36 | 121 | statement ok |
37 | | -DROP TABLE t09_0016 |
| 122 | +INSERT INTO test_tbl VALUES(2) |
38 | 123 |
|
39 | 124 | statement ok |
40 | | -DROP DATABASE db1 |
| 125 | +INSERT INTO test_tbl VALUES(3) |
| 126 | + |
| 127 | +query I |
| 128 | +select * from test_tbl order by a |
| 129 | +---- |
| 130 | +1 |
| 131 | +2 |
| 132 | +3 |
| 133 | + |
| 134 | +query B |
| 135 | +select count(*)=1 from fuse_snapshot('ee_vacuum_03_0018', 'test_tbl') |
| 136 | +---- |
| 137 | +1 |
| 138 | + |
| 139 | + |
41 | 140 |
|
0 commit comments