@@ -69,124 +69,124 @@ SELECT proname, provolatile FROM pg_proc
6969--
7070-- SECURITY DEFINER | INVOKER
7171--
72- CREATE FUNCTION functext_C_1 (int) RETURNS bool LANGUAGE 'sql'
72+ CREATE FUNCTION functest_C_1 (int) RETURNS bool LANGUAGE 'sql'
7373 AS 'SELECT $1 > 0';
74- CREATE FUNCTION functext_C_2 (int) RETURNS bool LANGUAGE 'sql'
74+ CREATE FUNCTION functest_C_2 (int) RETURNS bool LANGUAGE 'sql'
7575 SECURITY DEFINER AS 'SELECT $1 = 0';
76- CREATE FUNCTION functext_C_3 (int) RETURNS bool LANGUAGE 'sql'
76+ CREATE FUNCTION functest_C_3 (int) RETURNS bool LANGUAGE 'sql'
7777 SECURITY INVOKER AS 'SELECT $1 < 0';
7878SELECT proname, prosecdef FROM pg_proc
79- WHERE oid in ('functext_C_1 '::regproc,
80- 'functext_C_2 '::regproc,
81- 'functext_C_3 '::regproc) ORDER BY proname;
79+ WHERE oid in ('functest_C_1 '::regproc,
80+ 'functest_C_2 '::regproc,
81+ 'functest_C_3 '::regproc) ORDER BY proname;
8282 proname | prosecdef
8383--------------+-----------
84- functext_c_1 | f
85- functext_c_2 | t
86- functext_c_3 | f
84+ functest_c_1 | f
85+ functest_c_2 | t
86+ functest_c_3 | f
8787(3 rows)
8888
89- ALTER FUNCTION functext_C_1 (int) IMMUTABLE; -- unrelated change, no effect
90- ALTER FUNCTION functext_C_2 (int) SECURITY INVOKER;
91- ALTER FUNCTION functext_C_3 (int) SECURITY DEFINER;
89+ ALTER FUNCTION functest_C_1 (int) IMMUTABLE; -- unrelated change, no effect
90+ ALTER FUNCTION functest_C_2 (int) SECURITY INVOKER;
91+ ALTER FUNCTION functest_C_3 (int) SECURITY DEFINER;
9292SELECT proname, prosecdef FROM pg_proc
93- WHERE oid in ('functext_C_1 '::regproc,
94- 'functext_C_2 '::regproc,
95- 'functext_C_3 '::regproc) ORDER BY proname;
93+ WHERE oid in ('functest_C_1 '::regproc,
94+ 'functest_C_2 '::regproc,
95+ 'functest_C_3 '::regproc) ORDER BY proname;
9696 proname | prosecdef
9797--------------+-----------
98- functext_c_1 | f
99- functext_c_2 | f
100- functext_c_3 | t
98+ functest_c_1 | f
99+ functest_c_2 | f
100+ functest_c_3 | t
101101(3 rows)
102102
103103--
104104-- LEAKPROOF
105105--
106- CREATE FUNCTION functext_E_1 (int) RETURNS bool LANGUAGE 'sql'
106+ CREATE FUNCTION functest_E_1 (int) RETURNS bool LANGUAGE 'sql'
107107 AS 'SELECT $1 > 100';
108- CREATE FUNCTION functext_E_2 (int) RETURNS bool LANGUAGE 'sql'
108+ CREATE FUNCTION functest_E_2 (int) RETURNS bool LANGUAGE 'sql'
109109 LEAKPROOF AS 'SELECT $1 > 100';
110110SELECT proname, proleakproof FROM pg_proc
111- WHERE oid in ('functext_E_1 '::regproc,
112- 'functext_E_2 '::regproc) ORDER BY proname;
111+ WHERE oid in ('functest_E_1 '::regproc,
112+ 'functest_E_2 '::regproc) ORDER BY proname;
113113 proname | proleakproof
114114--------------+--------------
115- functext_e_1 | f
116- functext_e_2 | t
115+ functest_e_1 | f
116+ functest_e_2 | t
117117(2 rows)
118118
119- ALTER FUNCTION functext_E_1 (int) LEAKPROOF;
120- ALTER FUNCTION functext_E_2 (int) STABLE; -- unrelated change, no effect
119+ ALTER FUNCTION functest_E_1 (int) LEAKPROOF;
120+ ALTER FUNCTION functest_E_2 (int) STABLE; -- unrelated change, no effect
121121SELECT proname, proleakproof FROM pg_proc
122- WHERE oid in ('functext_E_1 '::regproc,
123- 'functext_E_2 '::regproc) ORDER BY proname;
122+ WHERE oid in ('functest_E_1 '::regproc,
123+ 'functest_E_2 '::regproc) ORDER BY proname;
124124 proname | proleakproof
125125--------------+--------------
126- functext_e_1 | t
127- functext_e_2 | t
126+ functest_e_1 | t
127+ functest_e_2 | t
128128(2 rows)
129129
130- ALTER FUNCTION functext_E_2 (int) NOT LEAKPROOF; -- remove leakproog attribute
130+ ALTER FUNCTION functest_E_2 (int) NOT LEAKPROOF; -- remove leakproog attribute
131131SELECT proname, proleakproof FROM pg_proc
132- WHERE oid in ('functext_E_1 '::regproc,
133- 'functext_E_2 '::regproc) ORDER BY proname;
132+ WHERE oid in ('functest_E_1 '::regproc,
133+ 'functest_E_2 '::regproc) ORDER BY proname;
134134 proname | proleakproof
135135--------------+--------------
136- functext_e_1 | t
137- functext_e_2 | f
136+ functest_e_1 | t
137+ functest_e_2 | f
138138(2 rows)
139139
140140-- it takes superuser privilege to turn on leakproof, but not for turn off
141- ALTER FUNCTION functext_E_1 (int) OWNER TO regress_unpriv_user;
142- ALTER FUNCTION functext_E_2 (int) OWNER TO regress_unpriv_user;
141+ ALTER FUNCTION functest_E_1 (int) OWNER TO regress_unpriv_user;
142+ ALTER FUNCTION functest_E_2 (int) OWNER TO regress_unpriv_user;
143143SET SESSION AUTHORIZATION regress_unpriv_user;
144144SET search_path TO temp_func_test, public;
145- ALTER FUNCTION functext_E_1 (int) NOT LEAKPROOF;
146- ALTER FUNCTION functext_E_2 (int) LEAKPROOF;
145+ ALTER FUNCTION functest_E_1 (int) NOT LEAKPROOF;
146+ ALTER FUNCTION functest_E_2 (int) LEAKPROOF;
147147ERROR: only superuser can define a leakproof function
148- CREATE FUNCTION functext_E_3 (int) RETURNS bool LANGUAGE 'sql'
148+ CREATE FUNCTION functest_E_3 (int) RETURNS bool LANGUAGE 'sql'
149149 LEAKPROOF AS 'SELECT $1 < 200'; -- failed
150150ERROR: only superuser can define a leakproof function
151151RESET SESSION AUTHORIZATION;
152152--
153153-- CALLED ON NULL INPUT | RETURNS NULL ON NULL INPUT | STRICT
154154--
155- CREATE FUNCTION functext_F_1 (int) RETURNS bool LANGUAGE 'sql'
155+ CREATE FUNCTION functest_F_1 (int) RETURNS bool LANGUAGE 'sql'
156156 AS 'SELECT $1 > 50';
157- CREATE FUNCTION functext_F_2 (int) RETURNS bool LANGUAGE 'sql'
157+ CREATE FUNCTION functest_F_2 (int) RETURNS bool LANGUAGE 'sql'
158158 CALLED ON NULL INPUT AS 'SELECT $1 = 50';
159- CREATE FUNCTION functext_F_3 (int) RETURNS bool LANGUAGE 'sql'
159+ CREATE FUNCTION functest_F_3 (int) RETURNS bool LANGUAGE 'sql'
160160 RETURNS NULL ON NULL INPUT AS 'SELECT $1 < 50';
161- CREATE FUNCTION functext_F_4 (int) RETURNS bool LANGUAGE 'sql'
161+ CREATE FUNCTION functest_F_4 (int) RETURNS bool LANGUAGE 'sql'
162162 STRICT AS 'SELECT $1 = 50';
163163SELECT proname, proisstrict FROM pg_proc
164- WHERE oid in ('functext_F_1 '::regproc,
165- 'functext_F_2 '::regproc,
166- 'functext_F_3 '::regproc,
167- 'functext_F_4 '::regproc) ORDER BY proname;
164+ WHERE oid in ('functest_F_1 '::regproc,
165+ 'functest_F_2 '::regproc,
166+ 'functest_F_3 '::regproc,
167+ 'functest_F_4 '::regproc) ORDER BY proname;
168168 proname | proisstrict
169169--------------+-------------
170- functext_f_1 | f
171- functext_f_2 | f
172- functext_f_3 | t
173- functext_f_4 | t
170+ functest_f_1 | f
171+ functest_f_2 | f
172+ functest_f_3 | t
173+ functest_f_4 | t
174174(4 rows)
175175
176- ALTER FUNCTION functext_F_1 (int) IMMUTABLE; -- unrelated change, no effect
177- ALTER FUNCTION functext_F_2 (int) STRICT;
178- ALTER FUNCTION functext_F_3 (int) CALLED ON NULL INPUT;
176+ ALTER FUNCTION functest_F_1 (int) IMMUTABLE; -- unrelated change, no effect
177+ ALTER FUNCTION functest_F_2 (int) STRICT;
178+ ALTER FUNCTION functest_F_3 (int) CALLED ON NULL INPUT;
179179SELECT proname, proisstrict FROM pg_proc
180- WHERE oid in ('functext_F_1 '::regproc,
181- 'functext_F_2 '::regproc,
182- 'functext_F_3 '::regproc,
183- 'functext_F_4 '::regproc) ORDER BY proname;
180+ WHERE oid in ('functest_F_1 '::regproc,
181+ 'functest_F_2 '::regproc,
182+ 'functest_F_3 '::regproc,
183+ 'functest_F_4 '::regproc) ORDER BY proname;
184184 proname | proisstrict
185185--------------+-------------
186- functext_f_1 | f
187- functext_f_2 | t
188- functext_f_3 | f
189- functext_f_4 | t
186+ functest_f_1 | f
187+ functest_f_2 | t
188+ functest_f_3 | f
189+ functest_f_4 | t
190190(4 rows)
191191
192192-- information_schema tests
@@ -236,15 +236,15 @@ drop cascades to function functest_a_3()
236236drop cascades to function functest_b_2(integer)
237237drop cascades to function functest_b_3(integer)
238238drop cascades to function functest_b_4(integer)
239- drop cascades to function functext_c_1 (integer)
240- drop cascades to function functext_c_2 (integer)
241- drop cascades to function functext_c_3 (integer)
242- drop cascades to function functext_e_1 (integer)
243- drop cascades to function functext_e_2 (integer)
244- drop cascades to function functext_f_1 (integer)
245- drop cascades to function functext_f_2 (integer)
246- drop cascades to function functext_f_3 (integer)
247- drop cascades to function functext_f_4 (integer)
239+ drop cascades to function functest_c_1 (integer)
240+ drop cascades to function functest_c_2 (integer)
241+ drop cascades to function functest_c_3 (integer)
242+ drop cascades to function functest_e_1 (integer)
243+ drop cascades to function functest_e_2 (integer)
244+ drop cascades to function functest_f_1 (integer)
245+ drop cascades to function functest_f_2 (integer)
246+ drop cascades to function functest_f_3 (integer)
247+ drop cascades to function functest_f_4 (integer)
248248drop cascades to function functest_b_2(bigint)
249249DROP USER regress_unpriv_user;
250250RESET search_path;
0 commit comments