mirror of https://github.com/citusdata/citus.git
move test in schedule file; add schema to test
parent
416a201281
commit
fd78c560d8
|
@ -1,5 +1,7 @@
|
||||||
|
CREATE SCHEMA function_with_case;
|
||||||
|
SET search_path TO function_with_case;
|
||||||
-- create function
|
-- create function
|
||||||
CREATE OR REPLACE FUNCTION public.test_err(v1 text)
|
CREATE OR REPLACE FUNCTION test_err(v1 text)
|
||||||
RETURNS text
|
RETURNS text
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
SECURITY DEFINER
|
SECURITY DEFINER
|
||||||
|
@ -14,13 +16,13 @@ do $$ declare
|
||||||
val text;
|
val text;
|
||||||
begin
|
begin
|
||||||
val = 'test';
|
val = 'test';
|
||||||
lNewValues = public.test_err(v1 => case when val::text = 'test'::text then 'yes' else 'no' end);
|
lNewValues = test_err(v1 => case when val::text = 'test'::text then 'yes' else 'no' end);
|
||||||
raise notice 'lNewValues= %', lNewValues;
|
raise notice 'lNewValues= %', lNewValues;
|
||||||
end;$$ ;
|
end;$$ ;
|
||||||
NOTICE: lNewValues= yes - ok
|
NOTICE: lNewValues= yes - ok
|
||||||
CONTEXT: PL/pgSQL function inline_code_block line XX at RAISE
|
CONTEXT: PL/pgSQL function inline_code_block line XX at RAISE
|
||||||
-- call function
|
-- call function
|
||||||
SELECT public.test_err('test');
|
SELECT test_err('test');
|
||||||
test_err
|
test_err
|
||||||
---------------------------------------------------------------------
|
---------------------------------------------------------------------
|
||||||
test - ok
|
test - ok
|
||||||
|
|
|
@ -110,6 +110,7 @@ test: run_command_on_all_nodes
|
||||||
test: background_task_queue_monitor
|
test: background_task_queue_monitor
|
||||||
test: other_databases grant_role_from_non_maindb role_operations_from_non_maindb seclabel_non_maindb
|
test: other_databases grant_role_from_non_maindb role_operations_from_non_maindb seclabel_non_maindb
|
||||||
test: citus_internal_access
|
test: citus_internal_access
|
||||||
|
test: function_with_case_when
|
||||||
|
|
||||||
# Causal clock test
|
# Causal clock test
|
||||||
test: clock
|
test: clock
|
||||||
|
@ -134,5 +135,3 @@ test: check_mx
|
||||||
test: generated_identity
|
test: generated_identity
|
||||||
test: drop_database
|
test: drop_database
|
||||||
test: check_cluster_state
|
test: check_cluster_state
|
||||||
|
|
||||||
test: function_with_case_when
|
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
CREATE SCHEMA function_with_case;
|
||||||
|
SET search_path TO function_with_case;
|
||||||
|
|
||||||
-- create function
|
-- create function
|
||||||
CREATE OR REPLACE FUNCTION public.test_err(v1 text)
|
CREATE OR REPLACE FUNCTION test_err(v1 text)
|
||||||
RETURNS text
|
RETURNS text
|
||||||
LANGUAGE plpgsql
|
LANGUAGE plpgsql
|
||||||
SECURITY DEFINER
|
SECURITY DEFINER
|
||||||
|
@ -14,9 +17,9 @@ do $$ declare
|
||||||
val text;
|
val text;
|
||||||
begin
|
begin
|
||||||
val = 'test';
|
val = 'test';
|
||||||
lNewValues = public.test_err(v1 => case when val::text = 'test'::text then 'yes' else 'no' end);
|
lNewValues = test_err(v1 => case when val::text = 'test'::text then 'yes' else 'no' end);
|
||||||
raise notice 'lNewValues= %', lNewValues;
|
raise notice 'lNewValues= %', lNewValues;
|
||||||
end;$$ ;
|
end;$$ ;
|
||||||
|
|
||||||
-- call function
|
-- call function
|
||||||
SELECT public.test_err('test');
|
SELECT test_err('test');
|
||||||
|
|
Loading…
Reference in New Issue