summaryrefslogtreecommitdiff
path: root/src/pl/plpython/sql/plpython_test.sql
diff options
context:
space:
mode:
authorNeil Conway <neilc@samurai.com>2006-02-28 20:03:52 +0000
committerNeil Conway <neilc@samurai.com>2006-02-28 20:03:52 +0000
commit87daae1143520309da299b78a8e7a68f141a268f (patch)
tree3ad11f9a73ee33a908d877869f88b79c1afaed63 /src/pl/plpython/sql/plpython_test.sql
parentc6b6f7ad6417ea64c4f56507b85287db97ce508c (diff)
downloadpostgresql-87daae1143520309da299b78a8e7a68f141a268f.tar.gz
Allow PL/Python functions to return void, per gripe from James Robinson
(I didn't use his patch, however). A void-returning PL/Python function must return None (from Python), which is translated into a void datum (and *not* NULL) for Postgres. I also added some regression tests for this functionality.
Diffstat (limited to 'src/pl/plpython/sql/plpython_test.sql')
-rw-r--r--src/pl/plpython/sql/plpython_test.sql5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/pl/plpython/sql/plpython_test.sql b/src/pl/plpython/sql/plpython_test.sql
index 17d6b2e792..2ebdb695a9 100644
--- a/src/pl/plpython/sql/plpython_test.sql
+++ b/src/pl/plpython/sql/plpython_test.sql
@@ -68,3 +68,8 @@ SELECT join_sequences(sequences) FROM sequences
SELECT newline_lf();
SELECT newline_cr();
SELECT newline_crlf();
+
+-- Tests for functions returning void
+SELECT test_void_func1(), test_void_func1() IS NULL AS "is null";
+SELECT test_void_func2(); -- should fail
+SELECT test_return_none(), test_return_none() IS NULL AS "is null";