@@ -1271,7 +1271,12 @@ class Item :public Value_source,
12711271 {
12721272 return type_handler ()->Item_send (this , protocol, buffer);
12731273 }
1274- virtual bool eq (const Item *, bool binary_cmp) const ;
1274+ struct Eq_config
1275+ {
1276+ bool binary_cmp; /* *< Make binary comparison */
1277+ Eq_config (bool binary_cmp) : binary_cmp(binary_cmp) {}
1278+ };
1279+ virtual bool eq (const Item *, const Eq_config &config) const ;
12751280 enum_field_types field_type () const
12761281 {
12771282 return type_handler ()->field_type ();
@@ -2907,11 +2912,11 @@ class Item_args
29072912 return true ;
29082913 }
29092914 bool excl_dep_on_grouping_fields (st_select_lex *sel);
2910- bool eq (const Item_args *other, bool binary_cmp ) const
2915+ bool eq (const Item_args *other, const Item::Eq_config &config ) const
29112916 {
29122917 for (uint i= 0 ; i < arg_count ; i++)
29132918 {
2914- if (!args[i]->eq (other->args [i], binary_cmp ))
2919+ if (!args[i]->eq (other->args [i], config ))
29152920 return false ;
29162921 }
29172922 return true ;
@@ -3131,7 +3136,7 @@ class Item_basic_value :public Item,
31313136 table, src, param,
31323137 type () == Item::NULL_ITEM);
31333138 }
3134- bool eq (const Item *item, bool binary_cmp ) const override ;
3139+ bool eq (const Item *item, const Eq_config &config ) const override ;
31353140 const Type_all_attributes *get_type_all_attributes_from_const () const
31363141 override
31373142 { return this ; }
@@ -3737,7 +3742,7 @@ class Item_field :public Item_ident,
37373742 */
37383743 Item_field (THD *thd, Field *field);
37393744 Type type () const override { return FIELD_ITEM; }
3740- bool eq (const Item *item, bool binary_cmp ) const override ;
3745+ bool eq (const Item *item, const Eq_config &config ) const override ;
37413746 double val_real () override ;
37423747 longlong val_int () override ;
37433748 my_decimal *val_decimal (my_decimal *) override ;
@@ -5870,10 +5875,10 @@ class Item_ref :public Item_ident
58705875 enum Type type () const override { return REF_ITEM; }
58715876 enum Type real_type () const override
58725877 { return ref ? (*ref)->type () : REF_ITEM; }
5873- bool eq (const Item *item, bool binary_cmp ) const override
5878+ bool eq (const Item *item, const Eq_config &config ) const override
58745879 {
58755880 const Item *it= item->real_item ();
5876- return ref && (*ref)->eq (it, binary_cmp );
5881+ return ref && (*ref)->eq (it, config );
58775882 }
58785883 void save_val (Field *to) override ;
58795884 void save_result (Field *to) override ;
@@ -6224,10 +6229,10 @@ class Item_cache_wrapper :public Item_result_field
62246229 { return orig_item->full_name_cstring (); }
62256230 void make_send_field (THD *thd, Send_field *field) override
62266231 { orig_item->make_send_field (thd, field); }
6227- bool eq (const Item *item, bool binary_cmp ) const override
6232+ bool eq (const Item *item, const Eq_config &config ) const override
62286233 {
62296234 const Item *it= item->real_item ();
6230- return orig_item->eq (it, binary_cmp );
6235+ return orig_item->eq (it, config );
62316236 }
62326237 void fix_after_pullout (st_select_lex *new_parent, Item **refptr, bool merge)
62336238 override
@@ -6336,7 +6341,7 @@ class Item_direct_view_ref :public Item_direct_ref
63366341 }
63376342
63386343 bool fix_fields (THD *, Item **) override ;
6339- bool eq (const Item *item, bool binary_cmp ) const override ;
6344+ bool eq (const Item *item, const Eq_config &config ) const override ;
63406345 Item *get_tmp_table_item (THD *thd) override
63416346 {
63426347 if (const_item ())
@@ -7002,7 +7007,7 @@ class Item_default_value : public Item_field
70027007 m_share_field= false ;
70037008 }
70047009 Type type () const override { return DEFAULT_VALUE_ITEM; }
7005- bool eq (const Item *item, bool binary_cmp ) const override ;
7010+ bool eq (const Item *item, const Eq_config &config ) const override ;
70067011 bool fix_fields (THD *, Item **) override ;
70077012 void cleanup () override ;
70087013 void print (String *str, enum_query_type query_type) override ;
@@ -7093,7 +7098,7 @@ class Item_contextually_typed_value_specification: public Item
70937098 { }
70947099 Type type () const override { return CONTEXTUALLY_TYPED_VALUE_ITEM; }
70957100 bool vcol_assignment_allowed_value () const override { return true ; }
7096- bool eq (const Item *item, bool binary_cmp ) const override { return false ; }
7101+ bool eq (const Item *item, const Eq_config &config ) const override { return false ; }
70977102 bool is_evaluable_expression () const override { return false ; }
70987103 Field *create_tmp_field_ex (MEM_ROOT *,
70997104 TABLE *, Tmp_field_src *,
@@ -7233,7 +7238,7 @@ class Item_insert_value : public Item_field
72337238 Item_insert_value (THD *thd, Name_resolution_context *context_arg, Item *a)
72347239 :Item_field(thd, context_arg),
72357240 arg (a) {}
7236- bool eq (const Item *item, bool binary_cmp ) const override ;
7241+ bool eq (const Item *item, const Eq_config &config ) const override ;
72377242 bool fix_fields (THD *, Item **) override ;
72387243 void print (String *str, enum_query_type query_type) override ;
72397244 int save_in_field (Field *field_arg, bool no_conversions) override
@@ -7325,7 +7330,7 @@ Item_trigger_field(THD *thd, Name_resolution_context *context_arg,
73257330 }
73267331 void setup_field (THD *thd, TABLE *table, GRANT_INFO *table_grant_info);
73277332 Type type () const override { return TRIGGER_FIELD_ITEM; }
7328- bool eq (const Item *item, bool binary_cmp ) const override ;
7333+ bool eq (const Item *item, const Eq_config &config ) const override ;
73297334 bool fix_fields (THD *, Item **) override ;
73307335 void print (String *str, enum_query_type query_type) override ;
73317336 table_map used_tables () const override { return (table_map)0L ; }
@@ -7454,7 +7459,7 @@ class Item_cache: public Item_fixed_hybrid,
74547459 {
74557460 return cached_field ? cached_field->eq_def (field) : FALSE ;
74567461 }
7457- bool eq (const Item *item, bool binary_cmp ) const override
7462+ bool eq (const Item *item, const Eq_config &config ) const override
74587463 {
74597464 return this == item;
74607465 }
@@ -8218,10 +8223,10 @@ class Item_direct_ref_to_item : public Item_direct_ref
82188223 { return m_item->full_name_cstring (); }
82198224 void make_send_field (THD *thd, Send_field *field) override
82208225 { m_item->make_send_field (thd, field); }
8221- bool eq (const Item *item, bool binary_cmp ) const override
8226+ bool eq (const Item *item, const Eq_config &config ) const override
82228227 {
82238228 const Item *it= item->real_item ();
8224- return m_item->eq (it, binary_cmp );
8229+ return m_item->eq (it, config );
82258230 }
82268231 void fix_after_pullout (st_select_lex *new_parent, Item **refptr, bool merge) override
82278232 { m_item->fix_after_pullout (new_parent, &m_item, merge); }
0 commit comments