diff options
author | Alexander Barkov <bar@mariadb.com> | 2018-03-20 13:02:44 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2019-02-23 17:43:59 +0400 |
commit | 80c3fd184d4eeb66cd520079c3d23595e52cfdc0 (patch) | |
tree | 1785816792a2a8b8616803de27366bd171f425b5 /sql/structs.h | |
parent | 8036ad541e9da4073a6136052e41c22c758b770e (diff) | |
download | mariadb-git-80c3fd184d4eeb66cd520079c3d23595e52cfdc0.tar.gz |
Backporting MDEV-15597 Add class Load_data_outvar and avoid using Item::STRING_ITEM for Item_user_var_as_out_param detection
This is a part of "MDEV-18045 Backporting the MDEV-15497 changes to 10.2 branch"
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 98eb0f2585d..378b8c387e0 100644 --- a/sql/structs.h +++ b/sql/structs.h @@ -629,4 +629,40 @@ public: }; +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 */ |