Add more regression test for single node Citus

Tests on commands with SCHEMA.
pull/4245/head
Onder Kalaci 2020-10-15 11:25:58 +02:00
parent 3e5a92d33b
commit 596f7bf4a9
2 changed files with 48 additions and 2 deletions

View File

@ -49,6 +49,13 @@ SELECT create_reference_table('ref');
(1 row)
CREATE TABLE local(c int, d int);
CREATE TABLE public.another_schema_table(a int);
SELECT create_distributed_table('public.another_schema_table', 'a');
create_distributed_table
---------------------------------------------------------------------
(1 row)
-- Confirm the basics work
INSERT INTO test VALUES (1, 2), (3, 4), (5, 6), (2, 7), (4, 5);
SELECT * FROM test WHERE x = 1;
@ -130,7 +137,24 @@ BEGIN;
INSERT INTO test VALUES (1, 2);
COMMIT;
CREATE INDEX single_node_i1 ON test(x);
DROP INDEX single_node_i1;
CREATE INDEX single_node_i2 ON test(x,y);
REINDEX SCHEMA single_node;
-- PG 11 does not support CONCURRENTLY
-- and we do not want to add a new output
-- file just for that. Enable the test
-- once we remove PG_VERSION_11
--REINDEX SCHEMA CONCURRENTLY single_node;
-- keep one of the indexes
-- drop w/wout tx blocks
BEGIN;
DROP INDEX single_node_i2;
ROLLBACK;
DROP INDEX single_node_i2;
-- change the schema w/wout TX block
BEGIN;
ALTER TABLE public.another_schema_table SET SCHEMA single_node;
ROLLBACK;
ALTER TABLE public.another_schema_table SET SCHEMA single_node;
BEGIN;
TRUNCATE test;
SELECT * FROM test;

View File

@ -30,6 +30,8 @@ CREATE TABLE ref(a int, b int);
SELECT create_reference_table('ref');
CREATE TABLE local(c int, d int);
CREATE TABLE public.another_schema_table(a int);
SELECT create_distributed_table('public.another_schema_table', 'a');
-- Confirm the basics work
INSERT INTO test VALUES (1, 2), (3, 4), (5, 6), (2, 7), (4, 5);
@ -71,7 +73,27 @@ BEGIN;
COMMIT;
CREATE INDEX single_node_i1 ON test(x);
DROP INDEX single_node_i1;
CREATE INDEX single_node_i2 ON test(x,y);
REINDEX SCHEMA single_node;
-- PG 11 does not support CONCURRENTLY
-- and we do not want to add a new output
-- file just for that. Enable the test
-- once we remove PG_VERSION_11
--REINDEX SCHEMA CONCURRENTLY single_node;
-- keep one of the indexes
-- drop w/wout tx blocks
BEGIN;
DROP INDEX single_node_i2;
ROLLBACK;
DROP INDEX single_node_i2;
-- change the schema w/wout TX block
BEGIN;
ALTER TABLE public.another_schema_table SET SCHEMA single_node;
ROLLBACK;
ALTER TABLE public.another_schema_table SET SCHEMA single_node;
BEGIN;
TRUNCATE test;