mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Support parameters in CALL
To support parameters in CALL, move the parse analysis of the procedure and arguments into the global transformation phase, so that the parser hooks can be applied. And then at execution time pass the parameters from ProcessUtility on to ExecuteCallStmt.
This commit is contained in:
@ -55,6 +55,22 @@ AS $$
|
||||
SELECT 5;
|
||||
$$;
|
||||
CALL ptest2();
|
||||
-- nested CALL
|
||||
TRUNCATE cp_test;
|
||||
CREATE PROCEDURE ptest3(y text)
|
||||
LANGUAGE SQL
|
||||
AS $$
|
||||
CALL ptest1(y);
|
||||
CALL ptest1($1);
|
||||
$$;
|
||||
CALL ptest3('b');
|
||||
SELECT * FROM cp_test;
|
||||
a | b
|
||||
---+---
|
||||
1 | b
|
||||
1 | b
|
||||
(2 rows)
|
||||
|
||||
-- various error cases
|
||||
CALL version(); -- error: not a procedure
|
||||
ERROR: version() is not a procedure
|
||||
|
@ -31,6 +31,21 @@ $$;
|
||||
CALL ptest2();
|
||||
|
||||
|
||||
-- nested CALL
|
||||
TRUNCATE cp_test;
|
||||
|
||||
CREATE PROCEDURE ptest3(y text)
|
||||
LANGUAGE SQL
|
||||
AS $$
|
||||
CALL ptest1(y);
|
||||
CALL ptest1($1);
|
||||
$$;
|
||||
|
||||
CALL ptest3('b');
|
||||
|
||||
SELECT * FROM cp_test;
|
||||
|
||||
|
||||
-- various error cases
|
||||
|
||||
CALL version(); -- error: not a procedure
|
||||
|
Reference in New Issue
Block a user