From cd331e4b845f9206aa89e4f31bb75a040fef87ba Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Fri, 3 Apr 2009 16:59:43 +0000
Subject: Defend against possible crash if a plpython function does not specify
 names for its arguments.  Also add a regression test, since someone
 apparently changed every single plpython test case to use only named
 parameters; else we'd have noticed this sooner.

Euler Taveira de Oliveira, per a report from Alvaro
---
 src/pl/plpython/sql/plpython_function.sql | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src/pl/plpython/sql/plpython_function.sql')

diff --git a/src/pl/plpython/sql/plpython_function.sql b/src/pl/plpython/sql/plpython_function.sql
index cf01e8e0cdc..a1544f3c422 100644
--- a/src/pl/plpython/sql/plpython_function.sql
+++ b/src/pl/plpython/sql/plpython_function.sql
@@ -391,8 +391,12 @@ $$ LANGUAGE plpythonu;
 
 
 --
--- Test named parameters
+-- Test named and nameless parameters
 --
+CREATE FUNCTION test_param_names0(integer, integer) RETURNS int AS $$
+return args[0] + args[1]
+$$ LANGUAGE plpythonu;
+
 CREATE FUNCTION test_param_names1(a0 integer, a1 text) RETURNS boolean AS $$
 assert a0 == args[0]
 assert a1 == args[1]
-- 
cgit v1.2.3

