diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-03-20 13:02:44 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2018-03-20 13:02:44 +0400 |
commit | e263530bea641e610a2cb6dac20da369272551b1 (patch) | |
tree | 49f4f10ea7710af1da81e653eea0fa8b872cf7e7 /sql/item_func.h | |
parent | 85ddd9e8ce11bef089ccc6c86745142d09639c14 (diff) | |
download | mariadb-git-e263530bea641e610a2cb6dac20da369272551b1.tar.gz |
MDEV-15597 Add class Load_data_outvar and avoid using Item::STRING_ITEM for Item_user_var_as_out_param detection
Diffstat (limited to 'sql/item_func.h')
-rw-r--r-- | sql/item_func.h | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/sql/item_func.h b/sql/item_func.h index 1c3302388aa..fb775b36ca4 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -2486,7 +2486,8 @@ public: in List<Item> and desire to place this code somewhere near other functions working with user variables. */ -class Item_user_var_as_out_param :public Item +class Item_user_var_as_out_param :public Item, + public Load_data_outvar { LEX_CSTRING org_name; user_var_entry *entry; @@ -2498,6 +2499,35 @@ public: org_name= *a; set_name(thd, a->str, a->length, system_charset_info); } + Load_data_outvar *get_load_data_outvar() + { + return this; + } + bool load_data_set_null(THD *thd, const Load_data_param *param) + { + set_null_value(param->charset()); + return false; + } + bool load_data_set_no_data(THD *thd, const Load_data_param *param) + { + set_null_value(param->charset()); + return false; + } + bool load_data_set_value(THD *thd, const char *pos, uint length, + const Load_data_param *param) + { + set_value(pos, length, param->charset()); + return false; + } + void load_data_print_for_log_event(THD *thd, String *to) const; + bool load_data_add_outvar(THD *thd, Load_data_param *param) const + { + return param->add_outvar_user_var(thd); + } + uint load_data_fixed_length() const + { + return 0; + } /* We should return something different from FIELD_ITEM here */ enum Type type() const { return STRING_ITEM;} double val_real(); @@ -2507,7 +2537,6 @@ public: my_decimal *val_decimal(my_decimal *decimal_buffer); /* fix_fields() binds variable name with its entry structure */ bool fix_fields(THD *thd, Item **ref); - void print_for_load(THD *thd, String *str) const; void set_null_value(CHARSET_INFO* cs); void set_value(const char *str, uint length, CHARSET_INFO* cs); const Type_handler *type_handler() const { return &type_handler_double; } |