summaryrefslogtreecommitdiff
path: root/sql/sp_pcontext.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2017-03-10 14:11:07 +0400
committerAlexander Barkov <bar@mariadb.org>2017-04-05 15:02:59 +0400
commit84c55a5668db582aa92dd2ccf076fbb783894b12 (patch)
treec6fccd62b326cae532b50965b37889d363111940 /sql/sp_pcontext.h
parentf429b5a834439e4f0c76e893487e33027d76b74b (diff)
downloadmariadb-git-84c55a5668db582aa92dd2ccf076fbb783894b12.tar.gz
MDEV-10581 sql_mode=ORACLE: Explicit cursor FOR LOOP
MDEV-12098 sql_mode=ORACLE: Implicit cursor FOR loop
Diffstat (limited to 'sql/sp_pcontext.h')
-rw-r--r--sql/sp_pcontext.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/sp_pcontext.h b/sql/sp_pcontext.h
index 6d8f5e1baf8..f6ed0ace60c 100644
--- a/sql/sp_pcontext.h
+++ b/sql/sp_pcontext.h
@@ -296,6 +296,7 @@ public:
{ }
class sp_pcontext *param_context() const { return m_param_context; }
class sp_lex_cursor *lex() const { return m_lex; }
+ bool check_param_count_with_error(uint param_count) const;
};
@@ -643,6 +644,18 @@ public:
const sp_pcursor *find_cursor(const LEX_STRING name,
uint *poff, bool current_scope_only) const;
+ const sp_pcursor *find_cursor_with_error(const LEX_STRING name,
+ uint *poff,
+ bool current_scope_only) const
+ {
+ const sp_pcursor *pcursor= find_cursor(name, poff, current_scope_only);
+ if (!pcursor)
+ {
+ my_error(ER_SP_CURSOR_MISMATCH, MYF(0), name.str);
+ return NULL;
+ }
+ return pcursor;
+ }
/// Find cursor by offset (for SHOW {PROCEDURE|FUNCTION} CODE only).
const sp_pcursor *find_cursor(uint offset) const;