Fix multi-1 tests

onder_view
Burak Velioglu 2022-04-13 02:10:12 +03:00
parent 69cf83ca22
commit 55278c9062
No known key found for this signature in database
GPG Key ID: F6827E620F6549C6
13 changed files with 34 additions and 40 deletions

View File

@ -46,21 +46,6 @@ FROM pg_catalog.pg_class c
WHERE n.nspname IN ('drop_partitioned_table', 'schema1')
AND c.relkind IN ('r','p')
ORDER BY 1, 2;
\c - - - :worker_1_port
SET search_path = drop_partitioned_table;
CREATE VIEW tables_info AS
SELECT n.nspname as "Schema",
c.relname as "Name",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'p' THEN 'partitioned table' END as "Type",
pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_user u ON u.usesysid = c.relowner
WHERE n.nspname IN ('drop_partitioned_table', 'schema1')
AND c.relkind IN ('r','p')
ORDER BY 1, 2;
\c - - - :master_port
SET search_path = drop_partitioned_table;
SET citus.next_shard_id TO 721000;
-- CASE 1
-- Dropping the parent table

View File

@ -177,7 +177,7 @@ SELECT * FROM run_command_on_workers($$SELECT pg_identify_object_as_address(clas
localhost | 57638 | t | (function,"{function_propagation_schema,func_6}",{function_propagation_schema.function_prop_table})
(2 rows)
-- Views are not supported
-- Views are supported
CREATE VIEW function_prop_view AS SELECT * FROM function_prop_table;
CREATE OR REPLACE FUNCTION func_7(param_1 function_prop_view)
RETURNS int
@ -187,8 +187,6 @@ BEGIN
return 1;
END;
$$;
WARNING: "function func_7(function_prop_view)" has dependency on unsupported object "view function_prop_view"
DETAIL: "function func_7(function_prop_view)" will be created only locally
CREATE OR REPLACE FUNCTION func_8(param_1 int)
RETURNS function_prop_view
LANGUAGE plpgsql AS
@ -197,8 +195,6 @@ BEGIN
return 1;
END;
$$;
WARNING: "function func_8(integer)" has dependency on unsupported object "view function_prop_view"
DETAIL: "function func_8(integer)" will be created only locally
-- Check within transaction
BEGIN;
CREATE TYPE type_in_transaction AS (a int, b int);

View File

@ -358,7 +358,12 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS c
(1 row)
CREATE VIEW local_regular_view AS SELECT * FROM local;
WARNING: "view local_regular_view" has dependency to "table local" that is not in Citus' metadata
DETAIL: "view local_regular_view" will be created only locally
HINT: Distribute "table local" first to distribute "view local_regular_view"
CREATE VIEW dist_regular_view AS SELECT * FROM distributed;
DEBUG: switching to sequential query execution mode
DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands
SELECT count(*) FROM distributed JOIN local_regular_view USING (id);
DEBUG: generating subplan XXX_1 for subquery SELECT local.id, local.title FROM local_dist_join_mixed.local
DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS count FROM (local_dist_join_mixed.distributed JOIN (SELECT intermediate_result.id, intermediate_result.title FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(id bigint, title text)) local_regular_view USING (id))
@ -1612,3 +1617,11 @@ drop cascades to table unlogged_local
drop cascades to materialized view mat_view
drop cascades to view local_regular_view
drop cascades to view dist_regular_view
DEBUG: drop cascades to view local_dist_join_mixed.dist_regular_view
DETAIL: from localhost:xxxxx
CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM
DEBUG: drop cascades to view local_dist_join_mixed.dist_regular_view
DETAIL: from localhost:xxxxx
CONTEXT: SQL statement "SELECT master_remove_distributed_table_metadata_from_workers(v_obj.objid, v_obj.schema_name, v_obj.object_name)"
PL/pgSQL function citus_drop_trigger() line XX at PERFORM

View File

@ -991,6 +991,9 @@ DEBUG: Plan XXX query after replacing subqueries and CTEs: SELECT count(*) AS c
(1 row)
CREATE view loc_view AS SELECT * FROM postgres_table WHERE key > 0;
WARNING: "view loc_view" has dependency to "table postgres_table" that is not in Citus' metadata
DETAIL: "view loc_view" will be created only locally
HINT: Distribute "table postgres_table" first to distribute "view loc_view"
UPDATE loc_view SET key = (SELECT COUNT(*) FROM distributed_table);
DEBUG: generating subplan XXX_1 for subquery SELECT count(*) AS count FROM local_table_join.distributed_table
DEBUG: Plan XXX query after replacing subqueries and CTEs: UPDATE local_table_join.postgres_table SET key = (SELECT intermediate_result.count FROM read_intermediate_result('XXX_1'::text, 'binary'::citus_copy_format) intermediate_result(count bigint)) FROM local_table_join.postgres_table WHERE (postgres_table.key OPERATOR(pg_catalog.>) 0)

View File

@ -166,8 +166,11 @@ SELECT master_get_table_ddl_events('fiddly_table');
ALTER TABLE public.fiddly_table OWNER TO postgres
(3 rows)
-- propagating views is not supported
-- propagating views is not supported if local table dependency exists
CREATE VIEW local_view AS SELECT * FROM simple_table;
WARNING: "view local_view" has dependency to "table simple_table" that is not in Citus' metadata
DETAIL: "view local_view" will be created only locally
HINT: Distribute "table simple_table" first to distribute "view local_view"
SELECT master_get_table_ddl_events('local_view');
ERROR: local_view is not a regular, foreign or partitioned table
-- clean up

View File

@ -1611,6 +1611,8 @@ DEBUG: Creating router plan
-- same scenario with a view
CREATE VIEW num_db AS
SELECT s.datid FROM number1() s LEFT JOIN pg_database d ON s.datid = d.oid;
DEBUG: switching to sequential query execution mode
DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands
SELECT 1 FROM authors_reference r JOIN num_db ON (r.id = num_db.datid) LIMIT 1;
DEBUG: found no worker with all shard placements
DEBUG: function does not have co-located tables

View File

@ -1996,6 +1996,8 @@ DEBUG: Creating router plan
-- views internally become subqueries, so not fast-path router query
CREATE VIEW test_view AS
SELECT * FROM articles_hash WHERE author_id = 1;
DEBUG: switching to sequential query execution mode
DETAIL: A command for a distributed view is run. To make sure subsequent commands see the view correctly we need to make sure to use only one connection for all future commands
SELECT * FROM test_view;
DEBUG: Creating router plan
DEBUG: query has a single distribution column value: 1

View File

@ -305,6 +305,9 @@ SELECT run_command_on_workers($$SELECT count(*) FROM pg_extension WHERE extname
-- propagated to the workers. the user should run it manually on the workers
CREATE TABLE t1 (A int);
CREATE VIEW v1 AS select * from t1;
WARNING: "view v1" has dependency to "table t1" that is not in Citus' metadata
DETAIL: "view v1" will be created only locally
HINT: Distribute "table t1" first to distribute "view v1"
ALTER EXTENSION seg ADD VIEW v1;
ALTER EXTENSION seg DROP VIEW v1;
DROP VIEW v1;

View File

@ -382,6 +382,9 @@ $Q$);
(2 rows)
CREATE VIEW local_table_v AS SELECT * FROM local_table WHERE a BETWEEN 1 AND 10;
WARNING: "view local_table_v" has dependency to "table local_table" that is not in Citus' metadata
DETAIL: "view local_table_v" will be created only locally
HINT: Distribute "table local_table" first to distribute "view local_table_v"
SELECT public.coordinator_plan($Q$
EXPLAIN (COSTS FALSE)
SELECT * FROM squares JOIN local_table_v ON squares.a = local_table_v.a;

View File

@ -636,7 +636,7 @@ INSERT INTO pg_catalog.pg_dist_object(classid, objid, objsubid) values('pg_class
INSERT INTO pg_catalog.pg_dist_object(classid, objid, objsubid) values('pg_class'::regclass::oid, 'second_dustbunnies'::regclass::oid, 0);
SELECT 1 FROM master_activate_node('localhost', :worker_1_port);
NOTICE: Replicating postgres objects to node localhost:57637
DETAIL: There are 115 objects to replicate, depending on your environment this might take a while
DETAIL: There are 118 objects to replicate, depending on your environment this might take a while
?column?
---------------------------------------------------------------------
1

View File

@ -52,22 +52,6 @@ WHERE n.nspname IN ('drop_partitioned_table', 'schema1')
AND c.relkind IN ('r','p')
ORDER BY 1, 2;
\c - - - :worker_1_port
SET search_path = drop_partitioned_table;
CREATE VIEW tables_info AS
SELECT n.nspname as "Schema",
c.relname as "Name",
CASE c.relkind WHEN 'r' THEN 'table' WHEN 'p' THEN 'partitioned table' END as "Type",
pg_catalog.pg_get_userbyid(c.relowner) as "Owner"
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
LEFT JOIN pg_user u ON u.usesysid = c.relowner
WHERE n.nspname IN ('drop_partitioned_table', 'schema1')
AND c.relkind IN ('r','p')
ORDER BY 1, 2;
\c - - - :master_port
SET search_path = drop_partitioned_table;
SET citus.next_shard_id TO 721000;
-- CASE 1

View File

@ -101,7 +101,7 @@ $$;
SELECT pg_identify_object_as_address(classid, objid, objsubid) from pg_catalog.pg_dist_object where objid = 'function_propagation_schema.func_6'::regproc::oid;
SELECT * FROM run_command_on_workers($$SELECT pg_identify_object_as_address(classid, objid, objsubid) from pg_catalog.pg_dist_object where objid = 'function_propagation_schema.func_6'::regproc::oid;$$) ORDER BY 1,2;
-- Views are not supported
-- Views are supported
CREATE VIEW function_prop_view AS SELECT * FROM function_prop_table;
CREATE OR REPLACE FUNCTION func_7(param_1 function_prop_view)
RETURNS int

View File

@ -116,7 +116,7 @@ ALTER TABLE fiddly_table
SELECT master_get_table_ddl_events('fiddly_table');
-- propagating views is not supported
-- propagating views is not supported if local table dependency exists
CREATE VIEW local_view AS SELECT * FROM simple_table;
SELECT master_get_table_ddl_events('local_view');