summaryrefslogtreecommitdiff
path: root/sql/sql_select.h
diff options
context:
space:
mode:
authorAlexander Barkov <bar@mariadb.org>2018-01-29 12:44:20 +0400
committerAlexander Barkov <bar@mariadb.org>2018-01-29 12:44:20 +0400
commitc7a2f23a7b751cd54dbdcff46a3e7bc1eabe4c02 (patch)
tree5f884e1fdf15a1a7d3738b1dff17a91d2c26623f /sql/sql_select.h
parentb4a2baffa82e5c07b96a1c752228560dcac1359b (diff)
parentb12430adc716be51810953920448563c87fe0521 (diff)
downloadmariadb-git-c7a2f23a7b751cd54dbdcff46a3e7bc1eabe4c02.tar.gz
Merge remote-tracking branch 'origin/bb-10.2-ext' into 10.3
Diffstat (limited to 'sql/sql_select.h')
-rw-r--r--sql/sql_select.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/sql/sql_select.h b/sql/sql_select.h
index 298097f1b98..0ae6d20a6e6 100644
--- a/sql/sql_select.h
+++ b/sql/sql_select.h
@@ -2184,6 +2184,48 @@ public:
@return true - on error (e.g. could not allocate the record buffer).
*/
bool open();
+
+ void set_all_fields_to_null()
+ {
+ for (uint i= 0; i < s->fields; i++)
+ field[i]->set_null();
+ }
+ /**
+ Set all fields from a compatible item list.
+ The number of fields in "this" must be equal to the number
+ of elements in "value".
+ */
+ bool sp_set_all_fields_from_item_list(THD *thd, List<Item> &items);
+
+ /**
+ Set all fields from a compatible item.
+ The number of fields in "this" must be the same with the number
+ of elements in "value".
+ */
+ bool sp_set_all_fields_from_item(THD *thd, Item *value);
+
+ /**
+ Find a ROW element index by its name
+ Assumes that "this" is used as a storage for a ROW-type SP variable.
+ @param [OUT] idx - the index of the found field is returned here
+ @param [IN] field_name - find a field with this name
+ @return true - on error (the field was not found)
+ @return false - on success (idx[0] was set to the field index)
+ */
+ bool sp_find_field_by_name(uint *idx, const LEX_CSTRING &name) const;
+
+ /**
+ Find a ROW element index by its name.
+ If the element is not found, and error is issued.
+ @param [OUT] idx - the index of the found field is returned here
+ @param [IN] var_name - the name of the ROW variable (for error reporting)
+ @param [IN] field_name - find a field with this name
+ @return true - on error (the field was not found)
+ @return false - on success (idx[0] was set to the field index)
+ */
+ bool sp_find_field_by_name_or_error(uint *idx,
+ const LEX_CSTRING &var_name,
+ const LEX_CSTRING &field_name) const;
};