Commit 47a8c6c3 authored by Alexander Barkov's avatar Alexander Barkov

- MDEV-9215 Detect cmp_type() and result_type() from field_type()

Part3: Deriving Item_splocal from Type_handler_hybrid_field_type
parent 3e471bf3
...@@ -1437,8 +1437,7 @@ Item_splocal::Item_splocal(THD *thd, const LEX_STRING &sp_var_name, ...@@ -1437,8 +1437,7 @@ Item_splocal::Item_splocal(THD *thd, const LEX_STRING &sp_var_name,
sp_var_type= real_type_to_type(sp_var_type); sp_var_type= real_type_to_type(sp_var_type);
m_type= sp_map_item_type(sp_var_type); m_type= sp_map_item_type(sp_var_type);
m_field_type= sp_var_type; set_handler_by_field_type(sp_var_type);
m_result_type= sp_map_result_type(sp_var_type);
} }
......
...@@ -2031,13 +2031,12 @@ inline bool Item_sp_variable::send(Protocol *protocol, String *str) ...@@ -2031,13 +2031,12 @@ inline bool Item_sp_variable::send(Protocol *protocol, String *str)
class Item_splocal :public Item_sp_variable, class Item_splocal :public Item_sp_variable,
private Settable_routine_parameter, private Settable_routine_parameter,
public Rewritable_query_parameter public Rewritable_query_parameter,
public Type_handler_hybrid_field_type
{ {
uint m_var_idx; uint m_var_idx;
Type m_type; Type m_type;
Item_result m_result_type;
enum_field_types m_field_type;
public: public:
Item_splocal(THD *thd, const LEX_STRING &sp_var_name, uint sp_var_idx, Item_splocal(THD *thd, const LEX_STRING &sp_var_name, uint sp_var_idx,
enum_field_types sp_var_type, enum_field_types sp_var_type,
...@@ -2055,8 +2054,12 @@ class Item_splocal :public Item_sp_variable, ...@@ -2055,8 +2054,12 @@ class Item_splocal :public Item_sp_variable,
inline uint get_var_idx() const; inline uint get_var_idx() const;
inline enum Type type() const; inline enum Type type() const;
inline Item_result result_type() const; enum_field_types field_type() const
inline enum_field_types field_type() const { return m_field_type; } { return Type_handler_hybrid_field_type::field_type(); }
enum Item_result result_type () const
{ return Type_handler_hybrid_field_type::result_type(); }
enum Item_result cmp_type () const
{ return Type_handler_hybrid_field_type::cmp_type(); }
private: private:
bool set_value(THD *thd, sp_rcontext *ctx, Item **it); bool set_value(THD *thd, sp_rcontext *ctx, Item **it);
...@@ -2092,12 +2095,6 @@ inline enum Item::Type Item_splocal::type() const ...@@ -2092,12 +2095,6 @@ inline enum Item::Type Item_splocal::type() const
return m_type; return m_type;
} }
inline Item_result Item_splocal::result_type() const
{
return m_result_type;
}
/***************************************************************************** /*****************************************************************************
A reference to case expression in SP, used in runtime. A reference to case expression in SP, used in runtime.
*****************************************************************************/ *****************************************************************************/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment