mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 12:02:42 +01:00
MDEV-12718 Determine Item::cmp_type() from Item::type_handler()
This commit is contained in:
parent
cc694792c9
commit
4e9022b48b
10 changed files with 3 additions and 35 deletions
|
@ -1694,7 +1694,7 @@ CALL p1();
|
|||
bool Item_splocal::check_cols(uint n)
|
||||
{
|
||||
DBUG_ASSERT(m_thd->spcont);
|
||||
if (cmp_type() != ROW_RESULT)
|
||||
if (Type_handler_hybrid_field_type::cmp_type() != ROW_RESULT)
|
||||
return Item::check_cols(n);
|
||||
|
||||
if (n != this_item()->cols() || n == 1)
|
||||
|
|
13
sql/item.h
13
sql/item.h
|
@ -751,7 +751,7 @@ public:
|
|||
return type_handler()->result_type();
|
||||
}
|
||||
/* ... while cmp_type() specifies how it should be compared */
|
||||
virtual Item_result cmp_type() const
|
||||
Item_result cmp_type() const
|
||||
{
|
||||
return type_handler()->cmp_type();
|
||||
}
|
||||
|
@ -2232,8 +2232,6 @@ public:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
uint cols() const { return this_item()->cols(); }
|
||||
Item* element_index(uint i) { return this_item()->element_index(i); }
|
||||
Item** addr(uint i) { return this_item()->addr(i); }
|
||||
|
@ -2833,7 +2831,6 @@ public:
|
|||
|
||||
const Type_handler *type_handler() const { return &type_handler_row; }
|
||||
Item_result result_type() const{ return ROW_RESULT ; }
|
||||
Item_result cmp_type() const { return ROW_RESULT; }
|
||||
uint cols() const { return arg_count; }
|
||||
bool element_index_by_name(uint *idx, const LEX_CSTRING &name) const;
|
||||
Item* element_index(uint i) { return arg_count ? args[i] : this; }
|
||||
|
@ -3094,8 +3091,6 @@ public:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
|
||||
Item_param(THD *thd, const LEX_CSTRING *name_arg,
|
||||
uint pos_in_query_arg, uint len_in_query_arg);
|
||||
|
@ -3913,7 +3908,6 @@ public:
|
|||
enum Type type() const { return DATE_ITEM; }
|
||||
bool eq(const Item *item, bool binary_cmp) const;
|
||||
enum Item_result result_type () const { return STRING_RESULT; }
|
||||
Item_result cmp_type() const { return TIME_RESULT; }
|
||||
|
||||
bool check_partition_func_processor(void *int_arg) {return FALSE;}
|
||||
|
||||
|
@ -5031,8 +5025,6 @@ public:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
|
||||
void make_field(THD *thd, Send_field *field) { item->make_field(thd, field); }
|
||||
table_map used_tables() const { return (table_map) 1L; }
|
||||
|
@ -5561,8 +5553,6 @@ public:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
|
||||
virtual void keep_array() {}
|
||||
virtual void print(String *str, enum_query_type query_type);
|
||||
|
@ -5685,7 +5675,6 @@ public:
|
|||
bool cache_value();
|
||||
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
|
||||
int save_in_field(Field *field, bool no_conversions);
|
||||
Item_result cmp_type() const { return TIME_RESULT; }
|
||||
void store_packed(longlong val_arg, Item *example);
|
||||
/*
|
||||
Having a clone_item method tells optimizer that this object
|
||||
|
|
|
@ -399,8 +399,6 @@ public:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
Field::geometry_type get_geometry_type() const
|
||||
{ return Type_geometry_attributes::get_geometry_type(); };
|
||||
};
|
||||
|
@ -2298,7 +2296,7 @@ public:
|
|||
void fix_length_and_dec();
|
||||
Field *create_field_for_create_select(TABLE *table)
|
||||
{
|
||||
return cmp_type() == STRING_RESULT ?
|
||||
return Type_handler_hybrid_field_type::cmp_type() == STRING_RESULT ?
|
||||
type_handler_long_blob.make_and_init_table_field(&(Item::name),
|
||||
Record_addr(maybe_null),
|
||||
*this, table) :
|
||||
|
|
|
@ -91,7 +91,6 @@ public:
|
|||
table_map used_tables() const { return used_tables_cache; };
|
||||
bool const_item() const { return const_item_cache; };
|
||||
enum Item_result result_type() const { return ROW_RESULT; }
|
||||
Item_result cmp_type() const { return ROW_RESULT; }
|
||||
void update_used_tables()
|
||||
{
|
||||
used_tables_and_const_cache_init();
|
||||
|
|
|
@ -1177,11 +1177,6 @@ enum Item_result Item_singlerow_subselect::result_type() const
|
|||
return engine->result_type();
|
||||
}
|
||||
|
||||
enum Item_result Item_singlerow_subselect::cmp_type() const
|
||||
{
|
||||
return engine->cmp_type();
|
||||
}
|
||||
|
||||
const Type_handler *Item_singlerow_subselect::type_handler() const
|
||||
{
|
||||
return engine->type_handler();
|
||||
|
|
|
@ -304,7 +304,6 @@ public:
|
|||
bool val_bool();
|
||||
bool get_date(MYSQL_TIME *ltime, ulonglong fuzzydate);
|
||||
enum Item_result result_type() const;
|
||||
enum Item_result cmp_type() const;
|
||||
const Type_handler *type_handler() const;
|
||||
void fix_length_and_dec();
|
||||
|
||||
|
|
|
@ -785,8 +785,6 @@ public:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
void fix_length_and_dec_double();
|
||||
void fix_length_and_dec_decimal();
|
||||
void reset_field();
|
||||
|
@ -1052,8 +1050,6 @@ protected:
|
|||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
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(); }
|
||||
void update_field();
|
||||
void min_max_update_str_field();
|
||||
void min_max_update_real_field();
|
||||
|
@ -1406,7 +1402,6 @@ class Item_sum_udf_float :public Item_udf_sum
|
|||
String *val_str(String*str);
|
||||
my_decimal *val_decimal(my_decimal *);
|
||||
enum Item_result result_type () const { return REAL_RESULT; }
|
||||
enum Item_result cmp_type () const { return REAL_RESULT; }
|
||||
const Type_handler *type_handler() const { return &type_handler_double; }
|
||||
void fix_length_and_dec() { fix_num_length_and_dec(); }
|
||||
Item *copy_or_same(THD* thd);
|
||||
|
@ -1644,7 +1639,6 @@ public:
|
|||
enum Sumfunctype sum_func () const {return GROUP_CONCAT_FUNC;}
|
||||
const char *func_name() const { return "group_concat("; }
|
||||
virtual Item_result result_type () const { return STRING_RESULT; }
|
||||
virtual Item_result cmp_type () const { return STRING_RESULT; }
|
||||
const Type_handler *type_handler() const
|
||||
{
|
||||
if (too_big_for_varchar())
|
||||
|
|
|
@ -528,7 +528,6 @@ public:
|
|||
Item_temporal_func(THD *thd, Item *a, Item *b): Item_func(thd, a, b) {}
|
||||
Item_temporal_func(THD *thd, Item *a, Item *b, Item *c): Item_func(thd, a, b, c) {}
|
||||
enum Item_result result_type () const { return STRING_RESULT; }
|
||||
Item_result cmp_type() const { return TIME_RESULT; }
|
||||
String *val_str(String *str);
|
||||
longlong val_int() { return val_int_from_date(); }
|
||||
double val_real() { return val_real_from_date(); }
|
||||
|
|
|
@ -305,8 +305,6 @@ class Item_sum_hybrid_simple : public Item_sum,
|
|||
String *val_str(String *);
|
||||
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(); }
|
||||
const Type_handler *type_handler() const
|
||||
{ return Type_handler_hybrid_field_type::type_handler(); }
|
||||
void update_field();
|
||||
|
|
|
@ -72,7 +72,6 @@ public:
|
|||
decimals=dec; max_length=float_length(dec);
|
||||
}
|
||||
enum Item_result result_type () const { return REAL_RESULT; }
|
||||
enum Item_result cmp_type () const { return REAL_RESULT; }
|
||||
const Type_handler *type_handler() const { return &type_handler_double; }
|
||||
void set(double nr) { value=nr; }
|
||||
void set(longlong nr) { value=(double) nr; }
|
||||
|
@ -100,7 +99,6 @@ public:
|
|||
Item_proc_int(THD *thd, const char *name_par): Item_proc(thd, name_par)
|
||||
{ max_length=11; }
|
||||
enum Item_result result_type () const { return INT_RESULT; }
|
||||
enum Item_result cmp_type () const { return INT_RESULT; }
|
||||
const Type_handler *type_handler() const { return &type_handler_longlong; }
|
||||
void set(double nr) { value=(longlong) nr; }
|
||||
void set(longlong nr) { value=nr; }
|
||||
|
@ -120,7 +118,6 @@ public:
|
|||
Item_proc_string(THD *thd, const char *name_par, uint length):
|
||||
Item_proc(thd, name_par) { this->max_length=length; }
|
||||
enum Item_result result_type () const { return STRING_RESULT; }
|
||||
enum Item_result cmp_type () const { return STRING_RESULT; }
|
||||
const Type_handler *type_handler() const { return &type_handler_varchar; }
|
||||
void set(double nr) { str_value.set_real(nr, 2, default_charset()); }
|
||||
void set(longlong nr) { str_value.set(nr, default_charset()); }
|
||||
|
|
Loading…
Reference in a new issue