Add alternative output for multi_deparse_function

Postgres tightened up its checks for invalid GUC names hence we started
to get an alternative output for one of our tests. We add an alternative
output since the file is relatively small.

Commit on PG:
3db826bd55cd1df0dd8c3d811f8e5b936d7ba1e4
pull/5209/head
Sait Talha Nisanci 2021-08-19 15:59:59 +03:00
parent 256e7d1540
commit 20c32a7a1d
4 changed files with 34 additions and 122 deletions

View File

@ -343,20 +343,6 @@ SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,maca
t t
(1 row) (1 row)
ALTER FUNCTION eq(macaddr,macaddr) SET "citus.setting;'" TO 'hello '' world';
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
verify_function_is_same_on_workers
---------------------------------------------------------------------
t
(1 row)
ALTER FUNCTION eq(macaddr,macaddr) RESET "citus.setting;'";
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
verify_function_is_same_on_workers
---------------------------------------------------------------------
t
(1 row)
ALTER FUNCTION eq(macaddr,macaddr) SET search_path TO 'sch'';ma', public; ALTER FUNCTION eq(macaddr,macaddr) SET search_path TO 'sch'';ma', public;
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)'); SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
verify_function_is_same_on_workers verify_function_is_same_on_workers
@ -540,9 +526,6 @@ SELECT * FROM run_command_on_workers('SELECT function_tests2.sum2(id) FROM (sele
localhost | 57638 | f | ERROR: function function_tests2.sum2(integer) does not exist localhost | 57638 | f | ERROR: function function_tests2.sum2(integer) does not exist
(2 rows) (2 rows)
-- postgres doesn't accept parameter names in the regprocedure input
SELECT create_distributed_function('eq_with_param_names(val1 macaddr, macaddr)', 'val1');
ERROR: invalid type name "val1 macaddr"
-- invalid distribution_arg_name -- invalid distribution_arg_name
SELECT create_distributed_function('eq_with_param_names(macaddr, macaddr)', distribution_arg_name:='test'); SELECT create_distributed_function('eq_with_param_names(macaddr, macaddr)', distribution_arg_name:='test');
ERROR: cannot distribute the function "eq_with_param_names" since the distribution argument is not valid ERROR: cannot distribute the function "eq_with_param_names" since the distribution argument is not valid

View File

@ -314,52 +314,6 @@ CONTEXT: PL/pgSQL function deparse_and_run_on_workers(text) line XX at RAISE
(localhost,57638,t,"ALTER FUNCTION") (localhost,57638,t,"ALTER FUNCTION")
(2 rows) (2 rows)
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO 'hello '' world';
$cmd$);
INFO: Propagating deparsed query: ALTER FUNCTION function_tests.add(integer, integer) SET "citus.setting;'" = 'hello '' world';
CONTEXT: PL/pgSQL function deparse_and_run_on_workers(text) line XX at RAISE
deparse_and_run_on_workers
---------------------------------------------------------------------
(localhost,57637,t,"ALTER FUNCTION")
(localhost,57638,t,"ALTER FUNCTION")
(2 rows)
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO -3.2;
$cmd$);
INFO: Propagating deparsed query: ALTER FUNCTION function_tests.add(integer, integer) SET "citus.setting;'" = -3.2;
CONTEXT: PL/pgSQL function deparse_and_run_on_workers(text) line XX at RAISE
deparse_and_run_on_workers
---------------------------------------------------------------------
(localhost,57637,t,"ALTER FUNCTION")
(localhost,57638,t,"ALTER FUNCTION")
(2 rows)
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO -32;
$cmd$);
INFO: Propagating deparsed query: ALTER FUNCTION function_tests.add(integer, integer) SET "citus.setting;'" = -32;
CONTEXT: PL/pgSQL function deparse_and_run_on_workers(text) line XX at RAISE
deparse_and_run_on_workers
---------------------------------------------------------------------
(localhost,57637,t,"ALTER FUNCTION")
(localhost,57638,t,"ALTER FUNCTION")
(2 rows)
-- This raises an error about only accepting one item,
-- that's okay, we're just testing that we don't produce bad syntax.
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO 'hello '' world', 'second '' item';
$cmd$);
INFO: Propagating deparsed query: ALTER FUNCTION function_tests.add(integer, integer) SET "citus.setting;'" = 'hello '' world', 'second '' item';
CONTEXT: PL/pgSQL function deparse_and_run_on_workers(text) line XX at RAISE
deparse_and_run_on_workers
---------------------------------------------------------------------
(localhost,57637,f,"ERROR: SET citus.setting;' takes only one argument")
(localhost,57638,f,"ERROR: SET citus.setting;' takes only one argument")
(2 rows)
SELECT deparse_and_run_on_workers($cmd$ SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add RESET log_min_messages ALTER FUNCTION add RESET log_min_messages
$cmd$); $cmd$);

View File

@ -233,10 +233,6 @@ ALTER ROUTINE eq(macaddr,macaddr) SET client_min_messages TO debug;
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)'); SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
ALTER FUNCTION eq(macaddr,macaddr) RESET client_min_messages; ALTER FUNCTION eq(macaddr,macaddr) RESET client_min_messages;
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)'); SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
ALTER FUNCTION eq(macaddr,macaddr) SET "citus.setting;'" TO 'hello '' world';
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
ALTER FUNCTION eq(macaddr,macaddr) RESET "citus.setting;'";
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
ALTER FUNCTION eq(macaddr,macaddr) SET search_path TO 'sch'';ma', public; ALTER FUNCTION eq(macaddr,macaddr) SET search_path TO 'sch'';ma', public;
SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)'); SELECT public.verify_function_is_same_on_workers('function_tests.eq(macaddr,macaddr)');
ALTER FUNCTION eq(macaddr,macaddr) RESET search_path; ALTER FUNCTION eq(macaddr,macaddr) RESET search_path;
@ -318,9 +314,6 @@ DROP AGGREGATE function_tests2.sum2(int);
-- call should fail as aggregate should have been dropped -- call should fail as aggregate should have been dropped
SELECT * FROM run_command_on_workers('SELECT function_tests2.sum2(id) FROM (select 1 id, 2) subq;') ORDER BY 1,2; SELECT * FROM run_command_on_workers('SELECT function_tests2.sum2(id) FROM (select 1 id, 2) subq;') ORDER BY 1,2;
-- postgres doesn't accept parameter names in the regprocedure input
SELECT create_distributed_function('eq_with_param_names(val1 macaddr, macaddr)', 'val1');
-- invalid distribution_arg_name -- invalid distribution_arg_name
SELECT create_distributed_function('eq_with_param_names(macaddr, macaddr)', distribution_arg_name:='test'); SELECT create_distributed_function('eq_with_param_names(macaddr, macaddr)', distribution_arg_name:='test');
SELECT create_distributed_function('eq_with_param_names(macaddr, macaddr)', distribution_arg_name:='int'); SELECT create_distributed_function('eq_with_param_names(macaddr, macaddr)', distribution_arg_name:='int');

View File

@ -166,24 +166,6 @@ SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET TIME ZONE '-7'; ALTER FUNCTION add(int, int) SET TIME ZONE '-7';
$cmd$); $cmd$);
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO 'hello '' world';
$cmd$);
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO -3.2;
$cmd$);
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO -32;
$cmd$);
-- This raises an error about only accepting one item,
-- that's okay, we're just testing that we don't produce bad syntax.
SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add(int, int) SET "citus.setting;'" TO 'hello '' world', 'second '' item';
$cmd$);
SELECT deparse_and_run_on_workers($cmd$ SELECT deparse_and_run_on_workers($cmd$
ALTER FUNCTION add RESET log_min_messages ALTER FUNCTION add RESET log_min_messages
$cmd$); $cmd$);