diff options
author | Alexander Barkov <bar@mariadb.org> | 2017-02-02 22:59:07 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2017-04-05 15:02:56 +0400 |
commit | 72f43df623261d5fe579cb355451d84216c8882d (patch) | |
tree | 6d2921d9e807e624244af9273b2332e184a5bc60 /sql/sp_pcontext.cc | |
parent | ffbb2bbc09e7fc8c0f60d5c42ce521b4c31c94a7 (diff) | |
download | mariadb-git-72f43df623261d5fe579cb355451d84216c8882d.tar.gz |
MDEV-10914 ROW data type for stored routine variables
Diffstat (limited to 'sql/sp_pcontext.cc')
-rw-r--r-- | sql/sp_pcontext.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/sql/sp_pcontext.cc b/sql/sp_pcontext.cc index 642f1f16d29..06c51642d68 100644 --- a/sql/sp_pcontext.cc +++ b/sql/sp_pcontext.cc @@ -563,3 +563,24 @@ const sp_pcursor *sp_pcontext::find_cursor(uint offset) const m_parent->find_cursor(offset) : // Some previous frame NULL; // Index out of bounds } + + +const Spvar_definition * +sp_variable::find_row_field(const LEX_STRING &var_name, + const LEX_STRING &field_name, + uint *row_field_offset) +{ + if (!field_def.is_row()) + { + my_printf_error(ER_UNKNOWN_ERROR, + "'%s' is not a row variable", MYF(0), var_name.str); + return NULL; + } + const Spvar_definition *def; + if ((def= field_def.find_row_field_by_name(field_name.str, row_field_offset))) + return def; + my_printf_error(ER_UNKNOWN_ERROR, + "Row variable '%s' does not have a field '%s'", + MYF(0), var_name.str, field_name.str); + return NULL; +} |