summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.h
diff options
context:
space:
mode:
authorunknown <bar@bar.mysql.r18.ru>2003-07-03 17:00:01 +0500
committerunknown <bar@bar.mysql.r18.ru>2003-07-03 17:00:01 +0500
commita98815346d7c46a3120f434c74fe9a807c2c0c9e (patch)
tree3556233c90d21238686d748fa9210d6207ef0c53 /sql/item_cmpfunc.h
parent2d61b30415bad18a145fcee0c7c34d2aa59bc5b5 (diff)
downloadmariadb-git-a98815346d7c46a3120f434c74fe9a807c2c0c9e.tar.gz
Row comparison now does compare field collations, e.g.
ROW('a','b','c) = ROW('A' collate latin1_bin,'b','c') returns 0 When a number is compared to a string, character sets and collations are not aggregated. e.g. this returned error in 4.1.0: SELECT 1=_latin2'1'; because character sets was aggregated, and 1 was considered as a string of latin1 charset during this aggregation.
Diffstat (limited to 'sql/item_cmpfunc.h')
-rw-r--r--sql/item_cmpfunc.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sql/item_cmpfunc.h b/sql/item_cmpfunc.h
index 1d93c9b6892..8309cd25a72 100644
--- a/sql/item_cmpfunc.h
+++ b/sql/item_cmpfunc.h
@@ -35,6 +35,8 @@ class Arg_comparator: public Sql_alloc
Arg_comparator *comparators; // used only for compare_row()
public:
+ DTCollation cmp_collation;
+
Arg_comparator() {};
Arg_comparator(Item **a1, Item **a2): a(a1), b(a2) {};
@@ -112,13 +114,10 @@ class Item_bool_func2 :public Item_int_func
protected:
Arg_comparator cmp;
String tmp_value1,tmp_value2;
- DTCollation cmp_collation;
public:
Item_bool_func2(Item *a,Item *b):
- Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1)
- { cmp_collation.set(0,DERIVATION_NONE);}
- bool fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref);
+ Item_int_func(a,b), cmp(tmp_arg, tmp_arg+1) {}
void fix_length_and_dec();
void set_cmp_func()
{