summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <igor@rurik.mysql.com>2004-02-19 01:09:54 -0800
committerunknown <igor@rurik.mysql.com>2004-02-19 01:09:54 -0800
commitf4353d48ccc39527540daf709a1167462b39738c (patch)
treeaa627335f475f099e0d352b39af4e24d6e1ac189 /sql/item_cmpfunc.h
parentc88e5213d4f8acbbba33d293a9573042818f0aec (diff)
parent9ce4695da0bfe74e840dcf708da10cac9740e137 (diff)
downloadmariadb-git-f4353d48ccc39527540daf709a1167462b39738c.tar.gz
Manual merge
mysql-test/r/func_test.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/user_var.result: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_cmpfunc.h: Auto merged sql/item_func.cc: Auto merged sql/item_func.h: Auto merged sql/item_row.cc: Auto merged sql/item_row.h: Auto merged sql/item_strfunc.h: Auto merged sql/sql_list.h: Auto merged sql/sql_select.h: Auto merged
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h34
1 files changed, 22 insertions, 12 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index d7cd0d93588..39b4e1802e1 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -87,7 +87,7 @@ public:
Item_bool_func() :Item_int_func() {}
Item_bool_func(Item *a) :Item_int_func(a) {}
Item_bool_func(Item *a,Item *b) :Item_int_func(a,b) {}
- Item_bool_func(THD *thd, Item_bool_func &item) :Item_int_func(thd, item) {}
+ Item_bool_func(THD *thd, Item_bool_func *item) :Item_int_func(thd, item) {}
void fix_length_and_dec() { decimals=0; max_length=1; }
};
@@ -196,17 +196,26 @@ public:
bool have_rev_func() const { return rev_functype() != UNKNOWN_FUNC; }
void print(String *str) { Item_func::print_op(str); }
bool is_null() { return test(args[0]->is_null() || args[1]->is_null()); }
+ CHARSET_INFO *compare_collation() { return cmp.cmp_collation.collation; }
friend class Arg_comparator;
};
class Item_bool_rowready_func2 :public Item_bool_func2
{
+ Item *orig_a, *orig_b; /* propagate_const can change parameters */
public:
- Item_bool_rowready_func2(Item *a,Item *b) :Item_bool_func2(a,b)
+ Item_bool_rowready_func2(Item *a,Item *b) :Item_bool_func2(a,b),
+ orig_a(a), orig_b(b)
{
allowed_arg_cols= a->cols();
}
+ void cleanup()
+ {
+ Item_bool_func2::cleanup();
+ tmp_arg[0]= orig_a;
+ tmp_arg[1]= orig_b;
+ }
};
class Item_func_not :public Item_bool_func
@@ -337,6 +346,7 @@ public:
const char *func_name() const { return "between"; }
void fix_length_and_dec();
void print(String *str);
+ CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
@@ -476,6 +486,7 @@ public:
const char *func_name() const { return "case"; }
void print(String *str);
Item *find_item(String *str);
+ CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
@@ -710,10 +721,6 @@ class Item_func_in :public Item_int_func
}
longlong val_int();
void fix_length_and_dec();
- ~Item_func_in()
- {
- cleanup(); /* This is not called by Item::~Item() */
- }
void cleanup()
{
delete array;
@@ -727,6 +734,7 @@ class Item_func_in :public Item_int_func
enum Functype functype() const { return IN_FUNC; }
const char *func_name() const { return " IN "; }
bool nulls_in_row();
+ CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
/* Functions used by where clause */
@@ -767,6 +775,7 @@ public:
table_map not_null_tables() const { return 0; }
optimize_type select_optimize() const { return OPTIMIZE_NULL; }
Item *neg_transformer();
+ CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
/* Functions used by HAVING for rewriting IN subquery */
@@ -801,6 +810,7 @@ public:
table_map not_null_tables() const { return 0; }
Item *neg_transformer();
void print(String *str);
+ CHARSET_INFO *compare_collation() { return args[0]->collation.collation; }
};
@@ -855,6 +865,7 @@ public:
bool fix_fields(THD *thd, struct st_table_list *tlist, Item **ref);
const char *func_name() const { return "regexp"; }
void print(String *str) { print_op(str); }
+ CHARSET_INFO *compare_collation() { return cmp_collation.collation; }
};
#else
@@ -890,10 +901,9 @@ public:
list.push_back(i1);
list.push_back(i2);
}
- Item_cond(THD *thd, Item_cond &item);
+ Item_cond(THD *thd, Item_cond *item);
Item_cond(List<Item> &nlist)
:Item_bool_func(), list(nlist), abort_on_null(0) {}
- ~Item_cond() { list.delete_elements(); }
bool add(Item *item) { return list.push_back(item); }
void add_at_head(List<Item> *nlist) { list.prepand(nlist); }
bool fix_fields(THD *, struct st_table_list *, Item **ref);
@@ -1053,7 +1063,7 @@ public:
to multiple equalities of upper and levels */
Item_cond_and() :Item_cond() {}
Item_cond_and(Item *i1,Item *i2) :Item_cond(i1,i2) {}
- Item_cond_and(THD *thd, Item_cond_and &item) :Item_cond(thd, item) {}
+ Item_cond_and(THD *thd, Item_cond_and *item) :Item_cond(thd, item) {}
Item_cond_and(List<Item> &list): Item_cond(list) {}
enum Functype functype() const { return COND_AND_FUNC; }
longlong val_int();
@@ -1061,7 +1071,7 @@ public:
Item* copy_andor_structure(THD *thd)
{
Item_cond_and *item;
- if((item= new Item_cond_and(thd, *this)))
+ if ((item= new Item_cond_and(thd, this)))
item->copy_andor_arguments(thd, this);
return item;
}
@@ -1073,7 +1083,7 @@ class Item_cond_or :public Item_cond
public:
Item_cond_or() :Item_cond() {}
Item_cond_or(Item *i1,Item *i2) :Item_cond(i1,i2) {}
- Item_cond_or(THD *thd, Item_cond_or &item) :Item_cond(thd, item) {}
+ Item_cond_or(THD *thd, Item_cond_or *item) :Item_cond(thd, item) {}
Item_cond_or(List<Item> &list): Item_cond(list) {}
enum Functype functype() const { return COND_OR_FUNC; }
longlong val_int();
@@ -1082,7 +1092,7 @@ public:
Item* copy_andor_structure(THD *thd)
{
Item_cond_or *item;
- if((item= new Item_cond_or(thd, *this)))
+ if ((item= new Item_cond_or(thd, this)))
item->copy_andor_arguments(thd, this);
return item;
}