~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to server/item_cmpfunc.h

  • Committer: Patrick Galbraith
  • Date: 2008-07-24 16:57:40 UTC
  • mto: (202.2.4 rename-mysql-to-drizzle)
  • mto: This revision was merged to the branch mainline in revision 212.
  • Revision ID: patg@ishvara-20080724165740-x58yw6zs6d9o17lf
Most everything working with client rename
mysqlslap test still fails... can't connect to the server

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; -*-
2
 
 *  vim:expandtab:shiftwidth=2:tabstop=2:smarttab:
3
 
 *
4
 
 *  Copyright (C) 2008 Sun Microsystems
5
 
 *
6
 
 *  This program is free software; you can redistribute it and/or modify
7
 
 *  it under the terms of the GNU General Public License as published by
8
 
 *  the Free Software Foundation; version 2 of the License.
9
 
 *
10
 
 *  This program is distributed in the hope that it will be useful,
11
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *  GNU General Public License for more details.
14
 
 *
15
 
 *  You should have received a copy of the GNU General Public License
16
 
 *  along with this program; if not, write to the Free Software
17
 
 *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18
 
 */
 
1
/* Copyright (C) 2000-2003 MySQL AB
 
2
 
 
3
   This program is free software; you can redistribute it and/or modify
 
4
   it under the terms of the GNU General Public License as published by
 
5
   the Free Software Foundation; version 2 of the License.
 
6
 
 
7
   This program is distributed in the hope that it will be useful,
 
8
   but WITHOUT ANY WARRANTY; without even the implied warranty of
 
9
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
10
   GNU General Public License for more details.
 
11
 
 
12
   You should have received a copy of the GNU General Public License
 
13
   along with this program; if not, write to the Free Software
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
19
15
 
20
16
 
21
17
/* compare and test functions */
22
18
 
 
19
#ifdef USE_PRAGMA_INTERFACE
 
20
#pragma interface                       /* gcc class implementation */
 
21
#endif
23
22
 
24
23
extern Item_result item_cmp_type(Item_result a,Item_result b);
25
24
class Item_bool_func2;
109
108
  Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {}
110
109
  bool is_bool_func() { return 1; }
111
110
  void fix_length_and_dec() { decimals=0; max_length=1; }
112
 
  uint32_t decimal_precision() const { return 1; }
 
111
  uint decimal_precision() const { return 1; }
113
112
};
114
113
 
115
114
 
199
198
 
200
199
 
201
200
class Item_cache;
202
 
#define UNKNOWN ((bool)-1)
 
201
#define UNKNOWN ((my_bool)-1)
203
202
 
204
203
 
205
204
/*
228
227
      FALSE   - result is FALSE
229
228
      TRUE    - result is NULL
230
229
  */
231
 
  bool result_for_null_param;
 
230
  my_bool result_for_null_param;
232
231
public:
233
232
  Item_in_optimizer(Item *a, Item_in_subselect *b):
234
 
    Item_bool_func(a, reinterpret_cast<Item *>(b)), cache(0),
 
233
    Item_bool_func(a, my_reinterpret_cast(Item *)(b)), cache(0),
235
234
    save_cache(0), result_for_null_param(UNKNOWN)
236
235
  { with_subselect= true; }
237
236
  bool fix_fields(THD *, Item **);
242
241
  const char *func_name() const { return "<in_optimizer>"; }
243
242
  Item_cache **get_cache() { return &cache; }
244
243
  void keep_top_level_cache();
245
 
  Item *transform(Item_transformer transformer, unsigned char *arg);
 
244
  Item *transform(Item_transformer transformer, uchar *arg);
246
245
};
247
246
 
248
247
class Comp_creator
348
347
 
349
348
  bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); }
350
349
  bool is_bool_func() { return 1; }
351
 
  const CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; }
352
 
  uint32_t decimal_precision() const { return 1; }
 
350
  CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; }
 
351
  uint decimal_precision() const { return 1; }
353
352
  void top_level_item() { abort_on_null= true; }
354
353
 
355
354
  friend class  Arg_comparator;
364
363
  }
365
364
  Item *neg_transformer(THD *thd);
366
365
  virtual Item *negated_item();
367
 
  bool subst_argument_checker(unsigned char **arg __attribute__((unused)))
 
366
  bool subst_argument_checker(uchar **arg __attribute__((__unused__)))
368
367
  { return true; }
369
368
};
370
369
 
485
484
  enum Functype rev_functype() const { return EQUAL_FUNC; }
486
485
  cond_result eq_cmp_result() const { return COND_TRUE; }
487
486
  const char *func_name() const { return "<=>"; }
488
 
  Item *neg_transformer(THD *thd __attribute__((unused))) { return 0; }
 
487
  Item *neg_transformer(THD *thd __attribute__((__unused__))) { return 0; }
489
488
};
490
489
 
491
490
 
576
575
public:
577
576
  inline void negate() { negated= !negated; }
578
577
  inline void top_level_item() { pred_level= 1; }
579
 
  Item *neg_transformer(THD *thd __attribute__((unused)))
 
578
  Item *neg_transformer(THD *thd __attribute__((__unused__)))
580
579
  {
581
580
    negated= !negated;
582
581
    return this;
583
582
  }
584
583
  bool eq(const Item *item, bool binary_cmp) const;
585
 
  bool subst_argument_checker(unsigned char **arg __attribute__((unused)))
 
584
  bool subst_argument_checker(uchar **arg __attribute__((__unused__)))
586
585
  { return true; }
587
586
};
588
587
 
607
606
  void fix_length_and_dec();
608
607
  virtual void print(String *str, enum_query_type query_type);
609
608
  bool is_bool_func() { return 1; }
610
 
  const CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
611
 
  uint32_t decimal_precision() const { return 1; }
 
609
  CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
 
610
  uint decimal_precision() const { return 1; }
612
611
};
613
612
 
614
613
 
637
636
class Item_func_interval :public Item_int_func
638
637
{
639
638
  Item_row *row;
640
 
  bool use_decimal_comparison;
 
639
  my_bool use_decimal_comparison;
641
640
  interval_range *intervals;
642
641
public:
643
642
  Item_func_interval(Item_row *a)
648
647
  int64_t val_int();
649
648
  void fix_length_and_dec();
650
649
  const char *func_name() const { return "interval"; }
651
 
  uint32_t decimal_precision() const { return 2; }
 
650
  uint decimal_precision() const { return 2; }
652
651
};
653
652
 
654
653
 
685
684
  enum_field_types field_type() const;
686
685
  void fix_length_and_dec();
687
686
  const char *func_name() const { return "ifnull"; }
688
 
  Field *tmp_table_field(Table *table);
689
 
  uint32_t decimal_precision() const;
 
687
  Field *tmp_table_field(TABLE *table);
 
688
  uint decimal_precision() const;
690
689
};
691
690
 
692
691
 
706
705
  enum_field_types field_type() const { return cached_field_type; }
707
706
  bool fix_fields(THD *, Item **);
708
707
  void fix_length_and_dec();
709
 
  uint32_t decimal_precision() const;
 
708
  uint decimal_precision() const;
710
709
  const char *func_name() const { return "if"; }
711
710
};
712
711
 
724
723
  my_decimal *val_decimal(my_decimal *);
725
724
  enum Item_result result_type () const { return cached_result_type; }
726
725
  void fix_length_and_dec();
727
 
  uint32_t decimal_precision() const { return args[0]->decimal_precision(); }
 
726
  uint decimal_precision() const { return args[0]->decimal_precision(); }
728
727
  const char *func_name() const { return "nullif"; }
729
728
 
730
729
  virtual inline void print(String *str, enum_query_type query_type)
746
745
{
747
746
public:
748
747
  char *base;
749
 
  uint32_t size;
 
748
  uint size;
750
749
  qsort2_cmp compare;
751
 
  const CHARSET_INFO *collation;
752
 
  uint32_t count;
753
 
  uint32_t used_count;
 
750
  CHARSET_INFO *collation;
 
751
  uint count;
 
752
  uint used_count;
754
753
  in_vector() {}
755
 
  in_vector(uint32_t elements,uint32_t element_length,qsort2_cmp cmp_func, 
756
 
            const CHARSET_INFO * const cmp_coll)
 
754
  in_vector(uint elements,uint element_length,qsort2_cmp cmp_func, 
 
755
            CHARSET_INFO *cmp_coll)
757
756
    :base((char*) sql_calloc(elements*element_length)),
758
757
     size(element_length), compare(cmp_func), collation(cmp_coll),
759
758
     count(elements), used_count(elements) {}
760
759
  virtual ~in_vector() {}
761
 
  virtual void set(uint32_t pos,Item *item)=0;
762
 
  virtual unsigned char *get_value(Item *item)=0;
 
760
  virtual void set(uint pos,Item *item)=0;
 
761
  virtual uchar *get_value(Item *item)=0;
763
762
  void sort()
764
763
  {
765
 
    my_qsort2(base,used_count,size,compare, (void *) collation);
 
764
    my_qsort2(base,used_count,size,compare,collation);
766
765
  }
767
766
  int find(Item *item);
768
767
  
784
783
        item  Constant item to store value into. The item must be of the same
785
784
              type that create_item() returns.
786
785
  */
787
 
  virtual void value_to_item(uint32_t pos __attribute__((unused)),
788
 
                             Item *item __attribute__((unused))) { }
 
786
  virtual void value_to_item(uint pos __attribute__((__unused__)),
 
787
                             Item *item __attribute__((__unused__))) { }
789
788
  
790
789
  /* Compare values number pos1 and pos2 for equality */
791
 
  bool compare_elems(uint32_t pos1, uint32_t pos2)
 
790
  bool compare_elems(uint pos1, uint pos2)
792
791
  {
793
792
    return test(compare(collation, base + pos1*size, base + pos2*size));
794
793
  }
800
799
  char buff[STRING_BUFFER_USUAL_SIZE];
801
800
  String tmp;
802
801
public:
803
 
  in_string(uint32_t elements,qsort2_cmp cmp_func, const CHARSET_INFO * const cs);
 
802
  in_string(uint elements,qsort2_cmp cmp_func, CHARSET_INFO *cs);
804
803
  ~in_string();
805
 
  void set(uint32_t pos,Item *item);
806
 
  unsigned char *get_value(Item *item);
 
804
  void set(uint pos,Item *item);
 
805
  uchar *get_value(Item *item);
807
806
  Item* create_item()
808
807
  { 
809
808
    return new Item_string(collation);
810
809
  }
811
 
  void value_to_item(uint32_t pos, Item *item)
 
810
  void value_to_item(uint pos, Item *item)
812
811
  {    
813
812
    String *str=((String*) base)+pos;
814
813
    Item_string *to= (Item_string*)item;
831
830
    int64_t unsigned_flag;  // Use int64_t, not bool, to preserve alignment
832
831
  } tmp;
833
832
public:
834
 
  in_int64_t(uint32_t elements);
835
 
  void set(uint32_t pos,Item *item);
836
 
  unsigned char *get_value(Item *item);
 
833
  in_int64_t(uint elements);
 
834
  void set(uint pos,Item *item);
 
835
  uchar *get_value(Item *item);
837
836
  
838
837
  Item* create_item()
839
838
  { 
843
842
    */
844
843
    return new Item_int((int64_t)0);
845
844
  }
846
 
  void value_to_item(uint32_t pos, Item *item)
 
845
  void value_to_item(uint pos, Item *item)
847
846
  {
848
847
    ((Item_int*) item)->value= ((packed_int64_t*) base)[pos].val;
849
 
    ((Item_int*) item)->unsigned_flag= (bool)
 
848
    ((Item_int*) item)->unsigned_flag= (my_bool)
850
849
      ((packed_int64_t*) base)[pos].unsigned_flag;
851
850
  }
852
851
  Item_result result_type() { return INT_RESULT; }
870
869
  /* Cache for the left item. */
871
870
  Item *lval_cache;
872
871
 
873
 
  in_datetime(Item *warn_item_arg, uint32_t elements)
 
872
  in_datetime(Item *warn_item_arg, uint elements)
874
873
    :in_int64_t(elements), thd(current_thd), warn_item(warn_item_arg),
875
874
     lval_cache(0) {};
876
 
  void set(uint32_t pos,Item *item);
877
 
  unsigned char *get_value(Item *item);
 
875
  void set(uint pos,Item *item);
 
876
  uchar *get_value(Item *item);
878
877
  friend int cmp_int64_t(void *cmp_arg, packed_int64_t *a,packed_int64_t *b);
879
878
};
880
879
 
883
882
{
884
883
  double tmp;
885
884
public:
886
 
  in_double(uint32_t elements);
887
 
  void set(uint32_t pos,Item *item);
888
 
  unsigned char *get_value(Item *item);
 
885
  in_double(uint elements);
 
886
  void set(uint pos,Item *item);
 
887
  uchar *get_value(Item *item);
889
888
  Item *create_item()
890
889
  { 
891
890
    return new Item_float(0.0, 0);
892
891
  }
893
 
  void value_to_item(uint32_t pos, Item *item)
 
892
  void value_to_item(uint pos, Item *item)
894
893
  {
895
894
    ((Item_float*)item)->value= ((double*) base)[pos];
896
895
  }
902
901
{
903
902
  my_decimal val;
904
903
public:
905
 
  in_decimal(uint32_t elements);
906
 
  void set(uint32_t pos, Item *item);
907
 
  unsigned char *get_value(Item *item);
 
904
  in_decimal(uint elements);
 
905
  void set(uint pos, Item *item);
 
906
  uchar *get_value(Item *item);
908
907
  Item *create_item()
909
908
  { 
910
909
    return new Item_decimal(0, false);
911
910
  }
912
 
  void value_to_item(uint32_t pos, Item *item)
 
911
  void value_to_item(uint pos, Item *item)
913
912
  {
914
913
    my_decimal *dec= ((my_decimal *)base) + pos;
915
914
    Item_decimal *item_dec= (Item_decimal*)item;
927
926
class cmp_item :public Sql_alloc
928
927
{
929
928
public:
930
 
  const CHARSET_INFO *cmp_charset;
 
929
  CHARSET_INFO *cmp_charset;
931
930
  cmp_item() { cmp_charset= &my_charset_bin; }
932
931
  virtual ~cmp_item() {}
933
932
  virtual void store_value(Item *item)= 0;
934
933
  virtual int cmp(Item *item)= 0;
935
934
  // for optimized IN with row
936
935
  virtual int compare(cmp_item *item)= 0;
937
 
  static cmp_item* get_comparator(Item_result type, const CHARSET_INFO * const cs);
 
936
  static cmp_item* get_comparator(Item_result type, CHARSET_INFO *cs);
938
937
  virtual cmp_item *make_same()= 0;
939
 
  virtual void store_value_by_template(cmp_item *tmpl  __attribute__((unused)),
 
938
  virtual void store_value_by_template(cmp_item *tmpl  __attribute__((__unused__)),
940
939
                                       Item *item)
941
940
  {
942
941
    store_value(item);
949
948
  String *value_res;
950
949
public:
951
950
  cmp_item_string () {}
952
 
  cmp_item_string (const CHARSET_INFO * const cs) { cmp_charset= cs; }
953
 
  void set_charset(const CHARSET_INFO * const cs) { cmp_charset= cs; }
 
951
  cmp_item_string (CHARSET_INFO *cs) { cmp_charset= cs; }
 
952
  void set_charset(CHARSET_INFO *cs) { cmp_charset= cs; }
954
953
  friend class cmp_item_sort_string;
955
954
  friend class cmp_item_sort_string_in_static;
956
955
};
963
962
public:
964
963
  cmp_item_sort_string():
965
964
    cmp_item_string() {}
966
 
  cmp_item_sort_string(const CHARSET_INFO * const cs):
 
965
  cmp_item_sort_string(CHARSET_INFO *cs):
967
966
    cmp_item_string(cs),
968
967
    value(value_buff, sizeof(value_buff), cs) {}
969
968
  void store_value(Item *item)
984
983
    return sortcmp(value_res, l_cmp->value_res, cmp_charset);
985
984
  } 
986
985
  cmp_item *make_same();
987
 
  void set_charset(const CHARSET_INFO * const cs)
 
986
  void set_charset(CHARSET_INFO *cs)
988
987
  {
989
988
    cmp_charset= cs;
990
989
    value.set_quick(value_buff, sizeof(value_buff), cs);
1080
1079
 protected:
1081
1080
  String value;
1082
1081
public:
1083
 
  cmp_item_sort_string_in_static(const CHARSET_INFO * const cs):
 
1082
  cmp_item_sort_string_in_static(CHARSET_INFO *cs):
1084
1083
    cmp_item_string(cs) {}
1085
1084
  void store_value(Item *item)
1086
1085
  {
1087
1086
    value_res= item->val_str(&value);
1088
1087
  }
1089
 
  int cmp(Item *item __attribute__((unused)))
 
1088
  int cmp(Item *item __attribute__((__unused__)))
1090
1089
  {
1091
1090
    // Should never be called
1092
1091
    assert(0);
1127
1126
  int first_expr_num, else_expr_num;
1128
1127
  enum Item_result cached_result_type, left_result_type;
1129
1128
  String tmp_value;
1130
 
  uint32_t ncases;
 
1129
  uint ncases;
1131
1130
  Item_result cmp_type;
1132
1131
  DTCollation cmp_collation;
1133
1132
  enum_field_types cached_field_type;
1150
1149
      list.push_back(else_expr_arg);
1151
1150
    }
1152
1151
    set_arguments(list);
1153
 
    memset(&cmp_items, 0, sizeof(cmp_items));
 
1152
    bzero(&cmp_items, sizeof(cmp_items));
1154
1153
  }
1155
1154
  double val_real();
1156
1155
  int64_t val_int();
1158
1157
  my_decimal *val_decimal(my_decimal *);
1159
1158
  bool fix_fields(THD *thd, Item **ref);
1160
1159
  void fix_length_and_dec();
1161
 
  uint32_t decimal_precision() const;
 
1160
  uint decimal_precision() const;
1162
1161
  table_map not_null_tables() const { return 0; }
1163
1162
  enum Item_result result_type () const { return cached_result_type; }
1164
1163
  enum_field_types field_type() const { return cached_field_type; }
1165
1164
  const char *func_name() const { return "case"; }
1166
1165
  virtual void print(String *str, enum_query_type query_type);
1167
1166
  Item *find_item(String *str);
1168
 
  const CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
 
1167
  CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
1169
1168
  void cleanup();
1170
1169
  void agg_str_lengths(Item *arg);
1171
1170
  void agg_num_lengths(Item *arg);
1207
1206
    :Item_func_opt_neg(list), array(0), have_null(0),
1208
1207
    arg_types_compatible(false)
1209
1208
  {
1210
 
    memset(&cmp_items, 0, sizeof(cmp_items));
 
1209
    bzero(&cmp_items, sizeof(cmp_items));
1211
1210
    allowed_arg_cols= 0;  // Fetch this value from first argument
1212
1211
  }
1213
1212
  int64_t val_int();
1214
1213
  bool fix_fields(THD *, Item **);
1215
1214
  void fix_length_and_dec();
1216
 
  uint32_t decimal_precision() const { return 1; }
 
1215
  uint decimal_precision() const { return 1; }
1217
1216
  void cleanup()
1218
1217
  {
1219
 
    uint32_t i;
 
1218
    uint i;
1220
1219
    Item_int_func::cleanup();
1221
1220
    delete array;
1222
1221
    array= 0;
1234
1233
  const char *func_name() const { return " IN "; }
1235
1234
  bool nulls_in_row();
1236
1235
  bool is_bool_func() { return 1; }
1237
 
  const CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
 
1236
  CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
1238
1237
};
1239
1238
 
1240
1239
class cmp_item_row :public cmp_item
1241
1240
{
1242
1241
  cmp_item **comparators;
1243
 
  uint32_t n;
 
1242
  uint n;
1244
1243
public:
1245
1244
  cmp_item_row(): comparators(0), n(0) {}
1246
1245
  ~cmp_item_row();
1258
1257
{
1259
1258
  cmp_item_row tmp;
1260
1259
public:
1261
 
  in_row(uint32_t elements, Item *);
 
1260
  in_row(uint elements, Item *);
1262
1261
  ~in_row();
1263
 
  void set(uint32_t pos,Item *item);
1264
 
  unsigned char *get_value(Item *item);
 
1262
  void set(uint pos,Item *item);
 
1263
  uchar *get_value(Item *item);
1265
1264
  friend void Item_func_in::fix_length_and_dec();
1266
1265
  Item_result result_type() { return ROW_RESULT; }
1267
1266
};
1305
1304
  table_map not_null_tables() const { return 0; }
1306
1305
  optimize_type select_optimize() const { return OPTIMIZE_NULL; }
1307
1306
  Item *neg_transformer(THD *thd);
1308
 
  const CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
 
1307
  CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
1309
1308
};
1310
1309
 
1311
1310
/* Functions used by HAVING for rewriting IN subquery */
1352
1351
  { return abort_on_null ? not_null_tables_cache : 0; }
1353
1352
  Item *neg_transformer(THD *thd);
1354
1353
  virtual void print(String *str, enum_query_type query_type);
1355
 
  const CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
 
1354
  CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
1356
1355
  void top_level_item() { abort_on_null=1; }
1357
1356
};
1358
1357
 
1429
1428
  void update_used_tables();
1430
1429
  virtual void print(String *str, enum_query_type query_type);
1431
1430
  void split_sum_func(THD *thd, Item **ref_pointer_array, List<Item> &fields);
1432
 
  friend int setup_conds(THD *thd, TableList *tables, TableList *leaves,
 
1431
  friend int setup_conds(THD *thd, TABLE_LIST *tables, TABLE_LIST *leaves,
1433
1432
                         COND **conds);
1434
1433
  void top_level_item() { abort_on_null=1; }
1435
1434
  void copy_andor_arguments(THD *thd, Item_cond *item);
1436
 
  bool walk(Item_processor processor, bool walk_subquery, unsigned char *arg);
1437
 
  Item *transform(Item_transformer transformer, unsigned char *arg);
 
1435
  bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
 
1436
  Item *transform(Item_transformer transformer, uchar *arg);
1438
1437
  void traverse_cond(Cond_traverser, void *arg, traverse_order order);
1439
1438
  void neg_arguments(THD *thd);
1440
 
  enum_field_types field_type() const { return DRIZZLE_TYPE_LONGLONG; }
1441
 
  bool subst_argument_checker(unsigned char **arg __attribute__((unused)))
 
1439
  enum_field_types field_type() const { return MYSQL_TYPE_LONGLONG; }
 
1440
  bool subst_argument_checker(uchar **arg __attribute__((__unused__)))
1442
1441
  { return true; }
1443
 
  Item *compile(Item_analyzer analyzer, unsigned char **arg_p,
1444
 
                Item_transformer transformer, unsigned char *arg_t);
 
1442
  Item *compile(Item_analyzer analyzer, uchar **arg_p,
 
1443
                Item_transformer transformer, uchar *arg_t);
1445
1444
};
1446
1445
 
1447
1446
 
1536
1535
  inline Item* get_const() { return const_item; }
1537
1536
  void add(Item *c);
1538
1537
  void add(Item_field *f);
1539
 
  uint32_t members();
 
1538
  uint members();
1540
1539
  bool contains(Field *field);
1541
1540
  Item_field* get_first() { return fields.head(); }
1542
1541
  void merge(Item_equal *item);
1550
1549
  void fix_length_and_dec();
1551
1550
  bool fix_fields(THD *thd, Item **ref);
1552
1551
  void update_used_tables();
1553
 
  bool walk(Item_processor processor, bool walk_subquery, unsigned char *arg);
1554
 
  Item *transform(Item_transformer transformer, unsigned char *arg);
 
1552
  bool walk(Item_processor processor, bool walk_subquery, uchar *arg);
 
1553
  Item *transform(Item_transformer transformer, uchar *arg);
1555
1554
  virtual void print(String *str, enum_query_type query_type);
1556
 
  const CHARSET_INFO *compare_collation() 
 
1555
  CHARSET_INFO *compare_collation() 
1557
1556
  { return fields.head()->collation.collation; }
1558
1557
}; 
1559
1558
 
1560
1559
class COND_EQUAL: public Sql_alloc
1561
1560
{
1562
1561
public:
1563
 
  uint32_t max_members;               /* max number of members the current level
 
1562
  uint max_members;               /* max number of members the current level
1564
1563
                                     list and all lower level lists */ 
1565
1564
  COND_EQUAL *upper_levels;       /* multiple equalities of upper and levels */
1566
1565
  List<Item_equal> current_level; /* list of multiple equalities of