summaryrefslogtreecommitdiff
path: root/sql/sp_rcontext.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2018-02-04 18:40:06 +0400
committerAlexander Barkov <bar@mariadb.org>2018-02-04 18:40:06 +0400
commit217fc122c8e893aa48fa5dcfb3dbfcc99a2aa299 (patch)
tree83093666c427b4770d82c0ff44f0d7034bec13a8 /sql/sp_rcontext.h
parentd6ed077fc82c2f4d20895db9a6b16ca295f23c33 (diff)
parent28d4cf0c1b3366c6471866d144ef28fced1e5390 (diff)
downloadmariadb-git-217fc122c8e893aa48fa5dcfb3dbfcc99a2aa299.tar.gz
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/sp_rcontext.h')
-rw-r--r--sql/sp_rcontext.h26
1 files changed, 22 insertions, 4 deletions
diff --git a/sql/sp_rcontext.h b/sql/sp_rcontext.h
index ab1238c5f25..8a03dca435d 100644
--- a/sql/sp_rcontext.h
+++ b/sql/sp_rcontext.h
@@ -191,6 +191,11 @@ public:
// SP-variables.
/////////////////////////////////////////////////////////////////////////
+ uint argument_count() const
+ {
+ return m_root_parsing_ctx->context_var_count();
+ }
+
int set_variable(THD *thd, uint var_idx, Item **value);
int set_variable_row_field(THD *thd, uint var_idx, uint field_idx,
Item **value);
@@ -198,11 +203,24 @@ public:
const LEX_CSTRING &field_name,
Item **value);
int set_variable_row(THD *thd, uint var_idx, List<Item> &items);
- Item *get_item(uint var_idx) const
+
+ int set_parameter(THD *thd, uint var_idx, Item **value)
+ {
+ DBUG_ASSERT(var_idx < argument_count());
+ return set_variable(thd, var_idx, value);
+ }
+
+ Item_field *get_variable(uint var_idx) const
{ return m_var_items[var_idx]; }
- Item **get_item_addr(uint var_idx) const
- { return m_var_items.array() + var_idx; }
+ Item **get_variable_addr(uint var_idx) const
+ { return ((Item **) m_var_items.array()) + var_idx; }
+
+ Item_field *get_parameter(uint var_idx) const
+ {
+ DBUG_ASSERT(var_idx < argument_count());
+ return get_variable(var_idx);
+ }
bool find_row_field_by_name_or_error(uint *field_idx, uint var_idx,
const LEX_CSTRING &field_name);
@@ -381,7 +399,7 @@ private:
/// Collection of Item_field proxies, each of them points to the
/// corresponding field in m_var_table.
- Bounds_checked_array<Item *> m_var_items;
+ Bounds_checked_array<Item_field *> m_var_items;
/// This is a pointer to a field, which should contain return value for
/// stored functions (only). For stored procedures, this pointer is NULL.