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/structs.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/structs.h')
-rw-r--r-- | sql/structs.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/sql/structs.h b/sql/structs.h index 4d05a2433cc..9bcbd1ba0df 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -729,4 +729,40 @@ struct Lex_string_with_pos_st: public LEX_CSTRING }; +class Load_data_param +{ +protected: + CHARSET_INFO *m_charset; // Character set of the file + ulonglong m_fixed_length; // Sum of target field lengths for fixed format + bool m_is_fixed_length; + bool m_use_blobs; +public: + Load_data_param(CHARSET_INFO *cs, bool is_fixed_length): + m_charset(cs), + m_fixed_length(0), + m_is_fixed_length(is_fixed_length), + m_use_blobs(false) + { } + bool add_outvar_field(THD *thd, const Field *field); + bool add_outvar_user_var(THD *thd); + CHARSET_INFO *charset() const { return m_charset; } + bool is_fixed_length() const { return m_is_fixed_length; } + bool use_blobs() const { return m_use_blobs; } +}; + + +class Load_data_outvar +{ +public: + virtual ~Load_data_outvar() {} + virtual bool load_data_set_null(THD *thd, const Load_data_param *param)= 0; + virtual bool load_data_set_value(THD *thd, const char *pos, uint length, + const Load_data_param *param)= 0; + virtual bool load_data_set_no_data(THD *thd, const Load_data_param *param)= 0; + virtual void load_data_print_for_log_event(THD *thd, class String *to) const= 0; + virtual bool load_data_add_outvar(THD *thd, Load_data_param *param) const= 0; + virtual uint load_data_fixed_length() const= 0; +}; + + #endif /* STRUCTS_INCLUDED */ |