Add a test which checks for resource clean-up

merge-cstore-pykello
Hadi Moshayedi 2020-10-05 10:28:50 -07:00
parent 7cc8c8c155
commit eeb25aca85
2 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,4 @@
SELECT count(*) AS columnar_table_count FROM cstore.cstore_tables \gset
CREATE TABLE t(a int, b int) USING cstore_tableam;
SELECT count(*) FROM cstore.cstore_stripes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t';
count
@ -87,3 +88,18 @@ SELECT stripe, attr, block, minimum_value IS NULL, maximum_value IS NULL FROM cs
2 | 2 | 0 | f | f
(6 rows)
-- Make sure we cleaned-up the transient table metadata after VACUUM FULL commands
SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables;
?column?
----------
1
(1 row)
DROP TABLE t;
-- Make sure we cleaned the metadata for t too
SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables;
?column?
----------
0
(1 row)

View File

@ -1,4 +1,7 @@
SELECT count(*) AS columnar_table_count FROM cstore.cstore_tables \gset
CREATE TABLE t(a int, b int) USING cstore_tableam;
SELECT count(*) FROM cstore.cstore_stripes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t';
INSERT INTO t SELECT i, i * i FROM generate_series(1, 10) i;
@ -35,3 +38,10 @@ VACUUM FULL t;
SELECT stripe, attr, block, minimum_value IS NULL, maximum_value IS NULL FROM cstore.cstore_skipnodes a, pg_class b WHERE a.relfilenode=b.relfilenode AND b.relname='t' ORDER BY 1, 2, 3;
-- Make sure we cleaned-up the transient table metadata after VACUUM FULL commands
SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables;
DROP TABLE t;
-- Make sure we cleaned the metadata for t too
SELECT count(*) - :columnar_table_count FROM cstore.cstore_tables;