@@ -16,7 +16,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
16
16
HINT: To call a function, use SELECT.
17
17
CREATE FUNCTION cp_testfunc1(a int) RETURNS int LANGUAGE SQL AS $$ SELECT a $$;
18
18
CREATE TABLE cp_test (a int, b text);
19
- @@ -16,47 +12,86 @@
19
+ @@ -16,47 +12,91 @@
20
20
INSERT INTO cp_test VALUES (1, x);
21
21
$$;
22
22
\df ptest1
@@ -51,9 +51,14 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
51
51
- INSERT INTO cp_test VALUES (1, x); +
52
52
- $procedure$ +
53
53
-
54
- + pg_get_functiondef
55
- +------------------------------------------------
56
- + INSERT INTO root.public.cp_test VALUES (1, x);
54
+ + pg_get_functiondef
55
+ +--------------------------------------------------------
56
+ + CREATE PROCEDURE public.ptest1(x STRING) +
57
+ + LANGUAGE SQL +
58
+ + SECURITY INVOKER +
59
+ + AS $$ +
60
+ + INSERT INTO root.public.cp_test VALUES (1, x);+
61
+ + $$
57
62
(1 row)
58
63
59
64
-- show only normal functions
@@ -132,7 +137,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
132
137
SELECT * FROM cp_test ORDER BY b COLLATE "C";
133
138
a | b
134
139
---+-------
135
- @@ -71,34 +106 ,47 @@
140
+ @@ -71,34 +111 ,47 @@
136
141
BEGIN ATOMIC
137
142
INSERT INTO cp_test VALUES (1, x);
138
143
END;
@@ -199,7 +204,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
199
204
200
205
-- utility functions currently not supported here
201
206
CREATE PROCEDURE ptestx()
202
- @@ -106,13 +154 ,27 @@
207
+ @@ -106,13 +159 ,27 @@
203
208
BEGIN ATOMIC
204
209
CREATE TABLE x (a int);
205
210
END;
@@ -228,7 +233,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
228
233
-- nested CALL
229
234
TRUNCATE cp_test;
230
235
CREATE PROCEDURE ptest3(y text)
231
- @@ -122,6 +184 ,9 @@
236
+ @@ -122,6 +189 ,9 @@
232
237
CALL ptest1($1);
233
238
$$;
234
239
CALL ptest3('b');
@@ -238,15 +243,15 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
238
243
SELECT * FROM cp_test;
239
244
a | b
240
245
---+---
241
- @@ -147,7 +212 ,6 @@
246
+ @@ -147,7 +217 ,6 @@
242
247
CALL ptest4a(a, b); -- error, not supported
243
248
$$;
244
249
ERROR: calling procedures with output arguments is not supported in SQL functions
245
250
-CONTEXT: SQL function "ptest4b"
246
251
DROP PROCEDURE ptest4a;
247
252
-- named and default parameters
248
253
CREATE OR REPLACE PROCEDURE ptest5(a int, b text, c int default 100)
249
- @@ -158,9 +222 ,23 @@
254
+ @@ -158,9 +227 ,23 @@
250
255
$$;
251
256
TRUNCATE cp_test;
252
257
CALL ptest5(10, 'Hello', 20);
@@ -270,7 +275,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
270
275
SELECT * FROM cp_test;
271
276
a | b
272
277
-----+-------
273
- @@ -168,11 +246 ,7 @@
278
+ @@ -168,11 +251 ,7 @@
274
279
20 | Hello
275
280
10 | Hello
276
281
100 | Hello
@@ -283,7 +288,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
283
288
284
289
-- polymorphic types
285
290
CREATE PROCEDURE ptest6(a int, b anyelement)
286
- @@ -181,6 +255 ,9 @@
291
+ @@ -181,6 +260 ,9 @@
287
292
SELECT NULL::int;
288
293
$$;
289
294
CALL ptest6(1, 2);
@@ -293,7 +298,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
293
298
-- collation assignment
294
299
CREATE PROCEDURE ptest7(a text, b text)
295
300
LANGUAGE SQL
296
- @@ -188,28 +265 ,47 @@
301
+ @@ -188,28 +270 ,47 @@
297
302
SELECT a = b;
298
303
$$;
299
304
CALL ptest7(least('a', 'b'), 'a');
@@ -356,7 +361,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
356
361
-- OUT parameters
357
362
CREATE PROCEDURE ptest9(OUT a int)
358
363
LANGUAGE SQL
359
- @@ -226,17 +322 ,10 @@
364
+ @@ -226,17 +327 ,10 @@
360
365
361
366
-- you can write an expression, but it's not evaluated
362
367
CALL ptest9(1/0); -- no error
@@ -376,7 +381,7 @@ diff -U3 --label=/mnt/data1/postgres/src/test/regress/expected/create_procedure.
376
381
-- check named-parameter matching
377
382
CREATE PROCEDURE ptest10(OUT a int, IN b int, IN c int)
378
383
LANGUAGE SQL AS $$ SELECT b - c $$;
379
- @@ -247,137 +336 ,222 @@
384
+ @@ -247,137 +341 ,222 @@
380
385
(1 row)
381
386
382
387
CALL ptest10(a => null, b => 8, c => 2);
0 commit comments