From: Peter Eisentraut Date: Thu, 31 Jan 2013 16:30:16 +0000 (-0500) Subject: Add more test cases for error conditions X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=d85d48490b88c99f0ab328fabd0bba69db24ed62;p=plproxy.git Add more test cases for error conditions --- diff --git a/test/expected/plproxy_errors.out b/test/expected/plproxy_errors.out index 94b0468..49acc3a 100644 --- a/test/expected/plproxy_errors.out +++ b/test/expected/plproxy_errors.out @@ -64,3 +64,39 @@ returns record as $$ $$ language plproxy; select * from test_map_err4('dat'); ERROR: PL/Proxy function public.test_map_err4(1): Compile error at line 5: CLUSTER statement missing +create function test_variadic_err(first text, rest variadic text[]) +returns text as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_variadic_err('dat', 'dat', 'dat'); +ERROR: PL/Proxy does not support variadic args +create function test_volatile_err(dat text) +returns text +stable +as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_volatile_err('dat'); +ERROR: PL/Proxy functions must be volatile +create function test_pseudo_arg_err(dat cstring) +returns text +as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_pseudo_arg_err(textout('dat')); +ERROR: PL/Proxy function public.test_pseudo_arg_err(0): unsupported pseudo type: cstring (2275) +create function test_pseudo_ret_err(dat text) +returns cstring +as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_pseudo_ret_err('dat'); +ERROR: PL/Proxy function public.test_pseudo_ret_err(0): unsupported pseudo type: cstring (2275) +create function test_runonall_err(dat text) +returns text +as $$ + cluster 'testcluster'; + run on all; +$$ language plproxy; +select * from test_runonall_err('dat'); +ERROR: PL/Proxy function public.test_runonall_err(1): RUN ON ALL requires set-returning function diff --git a/test/sql/plproxy_errors.sql b/test/sql/plproxy_errors.sql index 09bdf81..09f85a2 100644 --- a/test/sql/plproxy_errors.sql +++ b/test/sql/plproxy_errors.sql @@ -57,7 +57,38 @@ returns record as $$ $$ language plproxy; select * from test_map_err4('dat'); +create function test_variadic_err(first text, rest variadic text[]) +returns text as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_variadic_err('dat', 'dat', 'dat'); +create function test_volatile_err(dat text) +returns text +stable +as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_volatile_err('dat'); +create function test_pseudo_arg_err(dat cstring) +returns text +as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_pseudo_arg_err(textout('dat')); +create function test_pseudo_ret_err(dat text) +returns cstring +as $$ + cluster 'testcluster'; +$$ language plproxy; +select * from test_pseudo_ret_err('dat'); +create function test_runonall_err(dat text) +returns text +as $$ + cluster 'testcluster'; + run on all; +$$ language plproxy; +select * from test_runonall_err('dat');