diff options
author | ManoharKB <manohar.kb@nichi.com> | 2021-09-25 22:20:22 +0530 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2022-01-24 19:46:27 +0400 |
commit | 4572dc23f7d83dfffc9cf2577cea96a034c5332c (patch) | |
tree | 3dfaa6b3ccaff92647635020b911f9e2f84226a1 /sql/sp_head.h | |
parent | 5595ed9d9f20aeb463ac26e075c9cba41927e85e (diff) | |
download | mariadb-git-4572dc23f7d83dfffc9cf2577cea96a034c5332c.tar.gz |
MDEV-10654 add support IN, OUT, INOUT parameter qualifiers for stored functions
Problem: Currently stored function does not support IN/OUT/INOUT parameter qualifiers.
This is needed for Oracle compatibility (sql_mode = ORACLE).
Solution: Implemented parameter qualifier support to CREATE FUNCTION (reference: CREATE PROCEDURE)
Implemented return by reference for OUT/INOUT parameters in execute_function() (reference: execute_procedure())
Files changed:
sql/sql_yacc.yy: Added IN, OUT, INOUT parameter qualifiers for CREATE FUNCTION.
sql/sp_head.cc: Added input and output parameter binding for IN/OUT/INOUT parameters in execute_function() so that OUT/INOUT can return by reference.
sql/share/errmsg-utf8.txt: Added error message to restrict OUT/INOUT parameters while function being called from SQL query.
mysql-test/suite/compat/oracle/t/sp-inout.test: Added test cases
mysql-test/suite/compat/oracle/r/sp-inout.result: Added test results
Reviewed-by: iqbal@hasprime.com
Diffstat (limited to 'sql/sp_head.h')
-rw-r--r-- | sql/sp_head.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sql/sp_head.h b/sql/sp_head.h index 475f1e0d424..495de855e8e 100644 --- a/sql/sp_head.h +++ b/sql/sp_head.h @@ -505,6 +505,18 @@ private: sp_assignment_lex *param_lex, Item_args *parameters); + bool bind_input_param(THD *thd, + Item *arg_item, + uint arg_no, + sp_rcontext *nctx, + bool is_function); + + bool bind_output_param(THD *thd, + Item *arg_item, + uint arg_no, + sp_rcontext *octx, + sp_rcontext *nctx); + public: /** Generate a code for an "OPEN cursor" statement. |