From 293913568e6a7a86fd1479e1cff8e2ecb58d6568 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 15:44:03 +0200 Subject: Adding upstream version 16.2. Signed-off-by: Daniel Baumann --- src/pl/plpython/expected/plpython_void.out | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/pl/plpython/expected/plpython_void.out (limited to 'src/pl/plpython/expected/plpython_void.out') diff --git a/src/pl/plpython/expected/plpython_void.out b/src/pl/plpython/expected/plpython_void.out new file mode 100644 index 0000000..07d0760 --- /dev/null +++ b/src/pl/plpython/expected/plpython_void.out @@ -0,0 +1,30 @@ +-- +-- Tests for functions that return void +-- +CREATE FUNCTION test_void_func1() RETURNS void AS $$ +x = 10 +$$ LANGUAGE plpython3u; +-- illegal: can't return non-None value in void-returning func +CREATE FUNCTION test_void_func2() RETURNS void AS $$ +return 10 +$$ LANGUAGE plpython3u; +CREATE FUNCTION test_return_none() RETURNS int AS $$ +None +$$ LANGUAGE plpython3u; +-- Tests for functions returning void +SELECT test_void_func1(), test_void_func1() IS NULL AS "is null"; + test_void_func1 | is null +-----------------+--------- + | f +(1 row) + +SELECT test_void_func2(); -- should fail +ERROR: PL/Python function with return type "void" did not return None +CONTEXT: while creating return value +PL/Python function "test_void_func2" +SELECT test_return_none(), test_return_none() IS NULL AS "is null"; + test_return_none | is null +------------------+--------- + | t +(1 row) + -- cgit v1.2.3