diff --git a/src/test/regress/expected/coordinator_shouldhaveshards.out b/src/test/regress/expected/coordinator_shouldhaveshards.out index da38c3108..3ba3864c9 100644 --- a/src/test/regress/expected/coordinator_shouldhaveshards.out +++ b/src/test/regress/expected/coordinator_shouldhaveshards.out @@ -474,6 +474,34 @@ NOTICE: executing the command locally: SELECT worker_apply_shard_ddl_command (1 ROLLBACK; RESET citus.enable_cte_inlining; +CREATE table ref_table(x int, y int); +-- this will be replicated to the coordinator because of add_coordinator test +SELECT create_reference_table('ref_table'); + create_reference_table +--------------------------------------------------------------------- + +(1 row) + +TRUNCATE TABLE test; +BEGIN; +INSERT INTO test SELECT *, * FROM generate_series(1, 100); +NOTICE: executing the copy locally for shard xxxxx +NOTICE: executing the copy locally for shard xxxxx +INSERT INTO ref_table SELECT *, * FROM generate_series(1, 100); +NOTICE: executing the copy locally for shard xxxxx +SELECT COUNT(*) FROM test JOIN ref_table USING(x); +NOTICE: executing the command locally: SELECT count(*) AS count FROM (coordinator_shouldhaveshards.test_1503000 test JOIN coordinator_shouldhaveshards.ref_table_1503035 ref_table ON ((test.x OPERATOR(pg_catalog.=) ref_table.x))) WHERE true +NOTICE: executing the command locally: SELECT count(*) AS count FROM (coordinator_shouldhaveshards.test_1503003 test JOIN coordinator_shouldhaveshards.ref_table_1503035 ref_table ON ((test.x OPERATOR(pg_catalog.=) ref_table.x))) WHERE true + count +--------------------------------------------------------------------- + 100 +(1 row) + +ROLLBACK; +DROP TABLE ref_table; +NOTICE: executing the command locally: DROP TABLE IF EXISTS coordinator_shouldhaveshards.ref_table_xxxxx CASCADE +CONTEXT: SQL statement "SELECT master_drop_all_shards(v_obj.objid, v_obj.schema_name, v_obj.object_name)" +PL/pgSQL function citus_drop_trigger() line 19 at PERFORM DELETE FROM test; DROP TABLE test; DROP TABLE dist_table; diff --git a/src/test/regress/sql/coordinator_shouldhaveshards.sql b/src/test/regress/sql/coordinator_shouldhaveshards.sql index 18ebcb55a..96559832a 100644 --- a/src/test/regress/sql/coordinator_shouldhaveshards.sql +++ b/src/test/regress/sql/coordinator_shouldhaveshards.sql @@ -202,6 +202,19 @@ SELECT create_distributed_table('dist_table1', 'a'); ROLLBACK; RESET citus.enable_cte_inlining; +CREATE table ref_table(x int, y int); +-- this will be replicated to the coordinator because of add_coordinator test +SELECT create_reference_table('ref_table'); + +TRUNCATE TABLE test; + +BEGIN; +INSERT INTO test SELECT *, * FROM generate_series(1, 100); +INSERT INTO ref_table SELECT *, * FROM generate_series(1, 100); +SELECT COUNT(*) FROM test JOIN ref_table USING(x); +ROLLBACK; + +DROP TABLE ref_table; DELETE FROM test; DROP TABLE test;