From 6de2d7f050ee61329d8ca67224263c83c90f9176 Mon Sep 17 00:00:00 2001 From: Burak Velioglu Date: Thu, 10 Feb 2022 00:46:21 +0300 Subject: [PATCH] Fix check_multi tests --- .../regress/expected/aggregate_support.out | 2 + .../expected/forcedelegation_functions.out | 42 +++------------- .../expected/multi_function_in_join.out | 4 +- .../expected/multi_function_in_join_0.out | 2 + .../regress/expected/multi_prepare_sql.out | 4 -- .../multi_subquery_behavioral_analytics.out | 50 +------------------ .../expected/non_colocated_subquery_joins.out | 2 + src/test/regress/sql/aggregate_support.sql | 2 + .../regress/sql/forcedelegation_functions.sql | 8 +++ .../regress/sql/multi_function_in_join.sql | 2 + src/test/regress/sql/multi_prepare_sql.sql | 4 -- .../multi_subquery_behavioral_analytics.sql | 29 +---------- .../sql/non_colocated_subquery_joins.sql | 2 + 13 files changed, 32 insertions(+), 121 deletions(-) diff --git a/src/test/regress/expected/aggregate_support.out b/src/test/regress/expected/aggregate_support.out index 89ce53c70..bf35d7f4b 100644 --- a/src/test/regress/expected/aggregate_support.out +++ b/src/test/regress/expected/aggregate_support.out @@ -875,6 +875,7 @@ BEGIN RETURN $1 * $1; END; $function$; +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION square_func(int) RETURNS int LANGUAGE plpgsql @@ -883,6 +884,7 @@ BEGIN RETURN $1 * $1; END; $function$; +RESET citus.enable_metadata_sync; SELECT const_function(1), string_agg(a::character, ',') FROM t1; NOTICE: stable_fn called CONTEXT: PL/pgSQL function const_function(integer) line XX at RAISE diff --git a/src/test/regress/expected/forcedelegation_functions.out b/src/test/regress/expected/forcedelegation_functions.out index ad3b6cb8e..f0b5adad0 100644 --- a/src/test/regress/expected/forcedelegation_functions.out +++ b/src/test/regress/expected/forcedelegation_functions.out @@ -303,16 +303,12 @@ BEGIN END; $$ LANGUAGE plpgsql; SELECT create_distributed_function('func_calls_forcepush_func()'); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- (1 row) SELECT create_distributed_function('inner_force_delegation_function(int)', '$1', colocate_with := 'test_nested', force_delegation := true); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -367,6 +363,7 @@ $$ LANGUAGE plpgsql; -- select res into var from fn(); -- } -- +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION func_calls_forcepush_func_infrom() RETURNS NUMERIC AS $$ DECLARE incremented_val NUMERIC; @@ -377,6 +374,7 @@ BEGIN RETURN incremented_val; END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT func_calls_forcepush_func_infrom(); DEBUG: pushing down function call in a multi-statement transaction CONTEXT: SQL statement "SELECT inner_force_delegation_function FROM inner_force_delegation_function(add_val + 100)" @@ -418,6 +416,7 @@ COMMIT; -- select fn() into var; -- } -- +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION func_calls_forcepush_func_intarget() RETURNS NUMERIC AS $$ DECLARE incremented_val NUMERIC; @@ -428,6 +427,7 @@ BEGIN RETURN incremented_val; END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT func_calls_forcepush_func_intarget(); DEBUG: pushing down function call in a multi-statement transaction CONTEXT: SQL statement "SELECT inner_force_delegation_function(100 + 100) OFFSET 0" @@ -474,8 +474,6 @@ BEGIN END; $$ LANGUAGE plpgsql; SELECT create_distributed_function('test_recursive(int)', '$1', colocate_with := 'test_nested', force_delegation := true); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -549,8 +547,6 @@ SELECT create_distributed_function( '$1', colocate_with := 'test_forcepushdown', force_delegation := true); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -610,6 +606,7 @@ BEGIN INSERT INTO emp VALUES (empname, 33); END; $$ LANGUAGE plpgsql; +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION outer_emp() RETURNS void AS $$ @@ -618,9 +615,8 @@ BEGIN PERFORM inner_emp('hello'); END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT create_distributed_function('inner_emp(text)','empname', force_delegation := true); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -655,8 +651,6 @@ SELECT create_distributed_function( colocate_with := 'test_forcepushdown', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -730,8 +724,6 @@ SELECT create_distributed_function( colocate_with := 'test_forcepushdown', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -808,8 +800,6 @@ SELECT create_distributed_function( colocate_with := 'test_forcepushdown_char', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -826,8 +816,6 @@ SELECT create_distributed_function( colocate_with := 'test_forcepushdown_varchar', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -844,8 +832,6 @@ SELECT create_distributed_function( colocate_with := 'test_forcepushdown_text', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -952,8 +938,6 @@ SELECT create_distributed_function( colocate_with := 'test_subquery', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -974,8 +958,6 @@ SELECT create_distributed_function( colocate_with := 'test_subquery', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -995,8 +977,6 @@ SELECT create_distributed_function( colocate_with := 'test_subquery', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -1016,8 +996,6 @@ SELECT create_distributed_function( colocate_with := 'test_subquery', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -1038,8 +1016,6 @@ SELECT create_distributed_function( colocate_with := 'test_subquery', force_delegation := true ); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -1211,8 +1187,6 @@ BEGIN END; $$ LANGUAGE plpgsql; SELECT create_distributed_function('test_prepare(int,int)','x',force_delegation :=true, colocate_with := 'table_test_prepare'); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -1220,6 +1194,7 @@ DETAIL: A distributed function is created. To make sure subsequent commands see DROP FUNCTION outer_test_prepare(int, int); ERROR: function outer_test_prepare(integer, integer) does not exist +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION outer_test_prepare(x int, y int) RETURNS void AS $$ @@ -1230,6 +1205,7 @@ BEGIN PERFORM 1, 1 + a FROM test_prepare(x + 1, y + 1) a; END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; -- First 5 get delegated and succeeds BEGIN; SELECT outer_test_prepare(1,1); @@ -1406,8 +1382,6 @@ END; $$ LANGUAGE plpgsql; SELECT create_distributed_function('test(int)', 'x', colocate_with := 'test_perform', force_delegation := true); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- diff --git a/src/test/regress/expected/multi_function_in_join.out b/src/test/regress/expected/multi_function_in_join.out index 5d1b2a672..7db2aa967 100644 --- a/src/test/regress/expected/multi_function_in_join.out +++ b/src/test/regress/expected/multi_function_in_join.out @@ -40,8 +40,6 @@ CREATE FUNCTION add(integer, integer) RETURNS integer AS 'SELECT $1 + $2;' LANGUAGE SQL; SELECT create_distributed_function('add(integer,integer)'); -DEBUG: switching to sequential query execution mode -DETAIL: A distributed function is created. To make sure subsequent commands see the type correctly we need to make sure to use only one connection for all future commands create_distributed_function --------------------------------------------------------------------- @@ -198,6 +196,7 @@ SET client_min_messages TO ERROR; -- function joins in CTE results can create lateral joins that are not supported -- we execute the query within a function to consolidate the error messages -- between different executors +SET citus.enable_metadata_sync TO OFF; CREATE FUNCTION raise_failed_execution_func_join(query text) RETURNS void AS $$ BEGIN EXECUTE query; @@ -209,6 +208,7 @@ BEGIN END IF; END; $$LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT raise_failed_execution_func_join($$ WITH one_row AS ( SELECT * FROM table1 WHERE id=52 diff --git a/src/test/regress/expected/multi_function_in_join_0.out b/src/test/regress/expected/multi_function_in_join_0.out index 21279ab8d..db3389d75 100644 --- a/src/test/regress/expected/multi_function_in_join_0.out +++ b/src/test/regress/expected/multi_function_in_join_0.out @@ -200,6 +200,7 @@ SET client_min_messages TO ERROR; -- function joins in CTE results can create lateral joins that are not supported -- we execute the query within a function to consolidate the error messages -- between different executors +SET citus.enable_metadata_sync TO OFF; CREATE FUNCTION raise_failed_execution_func_join(query text) RETURNS void AS $$ BEGIN EXECUTE query; @@ -211,6 +212,7 @@ BEGIN END IF; END; $$LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT raise_failed_execution_func_join($$ WITH one_row AS ( SELECT * FROM table1 WHERE id=52 diff --git a/src/test/regress/expected/multi_prepare_sql.out b/src/test/regress/expected/multi_prepare_sql.out index 4f30bc716..6681f4112 100644 --- a/src/test/regress/expected/multi_prepare_sql.out +++ b/src/test/regress/expected/multi_prepare_sql.out @@ -1132,10 +1132,6 @@ DROP TABLE http_request; -- (re-)planning, but not when executing. -- first create helper function CREATE OR REPLACE FUNCTION immutable_bleat(text) RETURNS int LANGUAGE plpgsql IMMUTABLE AS $$BEGIN RAISE NOTICE '%', $1;RETURN 1;END$$; -\c - - - :worker_1_port -CREATE OR REPLACE FUNCTION immutable_bleat(text) RETURNS int LANGUAGE plpgsql IMMUTABLE AS $$BEGIN RAISE NOTICE '%', $1;RETURN 1;END$$; -\c - - - :worker_2_port -CREATE OR REPLACE FUNCTION immutable_bleat(text) RETURNS int LANGUAGE plpgsql IMMUTABLE AS $$BEGIN RAISE NOTICE '%', $1;RETURN 1;END$$; \c - - - :master_port -- test table CREATE TABLE test_table (test_id integer NOT NULL, data text); diff --git a/src/test/regress/expected/multi_subquery_behavioral_analytics.out b/src/test/regress/expected/multi_subquery_behavioral_analytics.out index e357132b4..1c64c6ab8 100644 --- a/src/test/regress/expected/multi_subquery_behavioral_analytics.out +++ b/src/test/regress/expected/multi_subquery_behavioral_analytics.out @@ -1563,22 +1563,8 @@ LIMIT 10; (10 rows) -- this is one complex join query derived from a user's production query --- first declare the function on workers on master +-- declare the function on workers and master -- With array_index: -SELECT * FROM run_command_on_workers('CREATE OR REPLACE FUNCTION array_index(ANYARRAY, ANYELEMENT) - RETURNS INT AS $$ - SELECT i - FROM (SELECT generate_series(array_lower($1, 1), array_upper($1, 1))) g(i) - WHERE $1 [i] = $2 - LIMIT 1; - $$ LANGUAGE sql') -ORDER BY 1,2; - nodename | nodeport | success | result ---------------------------------------------------------------------- - localhost | 57637 | t | CREATE FUNCTION - localhost | 57638 | t | CREATE FUNCTION -(2 rows) - CREATE OR REPLACE FUNCTION array_index(ANYARRAY, ANYELEMENT) RETURNS INT AS $$ SELECT i @@ -1745,14 +1731,6 @@ LIMIT 10; (10 rows) -- drop created functions -SELECT * FROM run_command_on_workers('DROP FUNCTION array_index(ANYARRAY, ANYELEMENT)') -ORDER BY 1,2; - nodename | nodeport | success | result ---------------------------------------------------------------------- - localhost | 57637 | t | DROP FUNCTION - localhost | 57638 | t | DROP FUNCTION -(2 rows) - DROP FUNCTION array_index(ANYARRAY, ANYELEMENT); -- a query with a constant subquery SELECT count(*) as subquery_count @@ -1987,21 +1965,6 @@ CREATE FUNCTION test_join_function_2(integer, integer) RETURNS bool LANGUAGE SQL IMMUTABLE RETURNS NULL ON NULL INPUT; -SELECT run_command_on_workers($f$ - -CREATE FUNCTION test_join_function_2(integer, integer) RETURNS bool - AS 'select $1 > $2;' - LANGUAGE SQL - IMMUTABLE - RETURNS NULL ON NULL INPUT; - -$f$); - run_command_on_workers ---------------------------------------------------------------------- - (localhost,57637,t,"CREATE FUNCTION") - (localhost,57638,t,"CREATE FUNCTION") -(2 rows) - -- we don't support joins via functions SELECT user_id, array_length(events_table, 1) FROM ( @@ -2285,16 +2248,5 @@ LIMIT 1; (1 row) DROP FUNCTION test_join_function_2(integer, integer); -SELECT run_command_on_workers($f$ - - DROP FUNCTION test_join_function_2(integer, integer); - -$f$); - run_command_on_workers ---------------------------------------------------------------------- - (localhost,57637,t,"DROP FUNCTION") - (localhost,57638,t,"DROP FUNCTION") -(2 rows) - SET citus.enable_router_execution TO TRUE; SET citus.subquery_pushdown to OFF; diff --git a/src/test/regress/expected/non_colocated_subquery_joins.out b/src/test/regress/expected/non_colocated_subquery_joins.out index 4fa460f4a..8f3db8492 100644 --- a/src/test/regress/expected/non_colocated_subquery_joins.out +++ b/src/test/regress/expected/non_colocated_subquery_joins.out @@ -20,6 +20,7 @@ SET citus.enable_repartition_joins TO ON; -- copied from multi_explain.sql and had to give -- a different name via postfix to prevent concurrent -- create/drop etc. +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION explain_json_2(query text) RETURNS jsonb AS $BODY$ @@ -30,6 +31,7 @@ BEGIN RETURN result; END; $BODY$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; -- leaf queries contain colocated joins -- but not the subquery SELECT true AS valid FROM explain_json_2($$ diff --git a/src/test/regress/sql/aggregate_support.sql b/src/test/regress/sql/aggregate_support.sql index dc7215f79..7c82418a7 100644 --- a/src/test/regress/sql/aggregate_support.sql +++ b/src/test/regress/sql/aggregate_support.sql @@ -459,6 +459,7 @@ RETURN $1 * $1; END; $function$; +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION square_func(int) RETURNS int LANGUAGE plpgsql @@ -467,6 +468,7 @@ BEGIN RETURN $1 * $1; END; $function$; +RESET citus.enable_metadata_sync; SELECT const_function(1), string_agg(a::character, ',') FROM t1; SELECT const_function(1), count(b) FROM t1; diff --git a/src/test/regress/sql/forcedelegation_functions.sql b/src/test/regress/sql/forcedelegation_functions.sql index 77b171fc1..778460c97 100644 --- a/src/test/regress/sql/forcedelegation_functions.sql +++ b/src/test/regress/sql/forcedelegation_functions.sql @@ -203,6 +203,7 @@ $$ LANGUAGE plpgsql; -- select res into var from fn(); -- } -- +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION func_calls_forcepush_func_infrom() RETURNS NUMERIC AS $$ DECLARE incremented_val NUMERIC; @@ -213,6 +214,7 @@ BEGIN RETURN incremented_val; END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT func_calls_forcepush_func_infrom(); @@ -227,6 +229,7 @@ COMMIT; -- select fn() into var; -- } -- +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION func_calls_forcepush_func_intarget() RETURNS NUMERIC AS $$ DECLARE incremented_val NUMERIC; @@ -237,6 +240,7 @@ BEGIN RETURN incremented_val; END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT func_calls_forcepush_func_intarget(); @@ -336,6 +340,7 @@ BEGIN INSERT INTO emp VALUES (empname, 33); END; $$ LANGUAGE plpgsql; +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION outer_emp() RETURNS void AS $$ @@ -344,6 +349,7 @@ BEGIN PERFORM inner_emp('hello'); END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT create_distributed_function('inner_emp(text)','empname', force_delegation := true); SELECT outer_emp(); @@ -631,6 +637,7 @@ $$ LANGUAGE plpgsql; SELECT create_distributed_function('test_prepare(int,int)','x',force_delegation :=true, colocate_with := 'table_test_prepare'); DROP FUNCTION outer_test_prepare(int, int); +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION outer_test_prepare(x int, y int) RETURNS void AS $$ @@ -641,6 +648,7 @@ BEGIN PERFORM 1, 1 + a FROM test_prepare(x + 1, y + 1) a; END; $$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; -- First 5 get delegated and succeeds BEGIN; diff --git a/src/test/regress/sql/multi_function_in_join.sql b/src/test/regress/sql/multi_function_in_join.sql index 6abdafdad..a379d050d 100644 --- a/src/test/regress/sql/multi_function_in_join.sql +++ b/src/test/regress/sql/multi_function_in_join.sql @@ -124,6 +124,7 @@ SET client_min_messages TO ERROR; -- function joins in CTE results can create lateral joins that are not supported -- we execute the query within a function to consolidate the error messages -- between different executors +SET citus.enable_metadata_sync TO OFF; CREATE FUNCTION raise_failed_execution_func_join(query text) RETURNS void AS $$ BEGIN EXECUTE query; @@ -135,6 +136,7 @@ BEGIN END IF; END; $$LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; SELECT raise_failed_execution_func_join($$ WITH one_row AS ( diff --git a/src/test/regress/sql/multi_prepare_sql.sql b/src/test/regress/sql/multi_prepare_sql.sql index 47fad0021..54893d025 100644 --- a/src/test/regress/sql/multi_prepare_sql.sql +++ b/src/test/regress/sql/multi_prepare_sql.sql @@ -610,10 +610,6 @@ DROP TABLE http_request; -- first create helper function CREATE OR REPLACE FUNCTION immutable_bleat(text) RETURNS int LANGUAGE plpgsql IMMUTABLE AS $$BEGIN RAISE NOTICE '%', $1;RETURN 1;END$$; -\c - - - :worker_1_port -CREATE OR REPLACE FUNCTION immutable_bleat(text) RETURNS int LANGUAGE plpgsql IMMUTABLE AS $$BEGIN RAISE NOTICE '%', $1;RETURN 1;END$$; -\c - - - :worker_2_port -CREATE OR REPLACE FUNCTION immutable_bleat(text) RETURNS int LANGUAGE plpgsql IMMUTABLE AS $$BEGIN RAISE NOTICE '%', $1;RETURN 1;END$$; \c - - - :master_port -- test table diff --git a/src/test/regress/sql/multi_subquery_behavioral_analytics.sql b/src/test/regress/sql/multi_subquery_behavioral_analytics.sql index 3e8953ead..f7860ce58 100644 --- a/src/test/regress/sql/multi_subquery_behavioral_analytics.sql +++ b/src/test/regress/sql/multi_subquery_behavioral_analytics.sql @@ -1278,17 +1278,8 @@ ORDER BY LIMIT 10; -- this is one complex join query derived from a user's production query --- first declare the function on workers on master +-- declare the function on workers and master -- With array_index: -SELECT * FROM run_command_on_workers('CREATE OR REPLACE FUNCTION array_index(ANYARRAY, ANYELEMENT) - RETURNS INT AS $$ - SELECT i - FROM (SELECT generate_series(array_lower($1, 1), array_upper($1, 1))) g(i) - WHERE $1 [i] = $2 - LIMIT 1; - $$ LANGUAGE sql') -ORDER BY 1,2; - CREATE OR REPLACE FUNCTION array_index(ANYARRAY, ANYELEMENT) RETURNS INT AS $$ SELECT i @@ -1431,8 +1422,6 @@ LIMIT 10; -- drop created functions -SELECT * FROM run_command_on_workers('DROP FUNCTION array_index(ANYARRAY, ANYELEMENT)') -ORDER BY 1,2; DROP FUNCTION array_index(ANYARRAY, ANYELEMENT); -- a query with a constant subquery @@ -1629,16 +1618,6 @@ CREATE FUNCTION test_join_function_2(integer, integer) RETURNS bool IMMUTABLE RETURNS NULL ON NULL INPUT; -SELECT run_command_on_workers($f$ - -CREATE FUNCTION test_join_function_2(integer, integer) RETURNS bool - AS 'select $1 > $2;' - LANGUAGE SQL - IMMUTABLE - RETURNS NULL ON NULL INPUT; - -$f$); - -- we don't support joins via functions SELECT user_id, array_length(events_table, 1) FROM ( @@ -1869,11 +1848,5 @@ LIMIT 1; DROP FUNCTION test_join_function_2(integer, integer); -SELECT run_command_on_workers($f$ - - DROP FUNCTION test_join_function_2(integer, integer); - -$f$); - SET citus.enable_router_execution TO TRUE; SET citus.subquery_pushdown to OFF; diff --git a/src/test/regress/sql/non_colocated_subquery_joins.sql b/src/test/regress/sql/non_colocated_subquery_joins.sql index d8a2aaea1..07c7893ca 100644 --- a/src/test/regress/sql/non_colocated_subquery_joins.sql +++ b/src/test/regress/sql/non_colocated_subquery_joins.sql @@ -25,6 +25,7 @@ SET citus.enable_repartition_joins TO ON; -- copied from multi_explain.sql and had to give -- a different name via postfix to prevent concurrent -- create/drop etc. +SET citus.enable_metadata_sync TO OFF; CREATE OR REPLACE FUNCTION explain_json_2(query text) RETURNS jsonb AS $BODY$ @@ -35,6 +36,7 @@ BEGIN RETURN result; END; $BODY$ LANGUAGE plpgsql; +RESET citus.enable_metadata_sync; -- leaf queries contain colocated joins