summaryrefslogtreecommitdiff
path: root/sql/item_cmpfunc.cc
diff options
context:
space:
mode:
authorunknown <bell@sanja.is.com.ua>2003-08-11 11:51:33 +0300
committerunknown <bell@sanja.is.com.ua>2003-08-11 11:51:33 +0300
commite64769909ce410eb052c26ed09875b34a653c1aa (patch)
treecc66619bf32dd812402d0ab049143317f87a272c /sql/item_cmpfunc.cc
parent6181294dab759a6f5197573f164ee061668b1d18 (diff)
parentb9aa175cb282ce92e733412a74e23ba750f8dd80 (diff)
downloadmariadb-git-e64769909ce410eb052c26ed09875b34a653c1aa.tar.gz
merge
sql/item.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_func.cc: Auto merged sql/item_strfunc.h: Auto merged sql/item_sum.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_derived.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_union.cc: Auto merged sql/table.h: Auto merged
Diffstat (limited to 'sql/item_cmpfunc.cc')
-rw-r--r--sql/item_cmpfunc.cc42
1 files changed, 22 insertions, 20 deletions
diff --git a/sql/item_cmpfunc.cc b/sql/item_cmpfunc.cc
index 5b19e4b745b..c78e032c943 100644
--- a/sql/item_cmpfunc.cc
+++ b/sql/item_cmpfunc.cc
@@ -151,15 +151,17 @@ void Item_bool_func2::fix_length_and_dec()
uint strong= 0;
uint weak= 0;
- if ((args[0]->derivation() < args[1]->derivation()) &&
- !my_charset_same(args[0]->charset(), args[1]->charset()) &&
- (args[0]->charset()->state & MY_CS_UNICODE))
+ if ((args[0]->collation.derivation < args[1]->collation.derivation) &&
+ !my_charset_same(args[0]->collation.collation,
+ args[1]->collation.collation) &&
+ (args[0]->collation.collation->state & MY_CS_UNICODE))
{
weak= 1;
}
- else if ((args[1]->derivation() < args[0]->derivation()) &&
- !my_charset_same(args[0]->charset(), args[1]->charset()) &&
- (args[1]->charset()->state & MY_CS_UNICODE))
+ else if ((args[1]->collation.derivation < args[0]->collation.derivation) &&
+ !my_charset_same(args[0]->collation.collation,
+ args[1]->collation.collation) &&
+ (args[1]->collation.collation->state & MY_CS_UNICODE))
{
strong= 1;
}
@@ -172,15 +174,15 @@ void Item_bool_func2::fix_length_and_dec()
String tmp, cstr;
String *ostr= args[weak]->val_str(&tmp);
cstr.copy(ostr->ptr(), ostr->length(), ostr->charset(),
- args[strong]->charset());
+ args[strong]->collation.collation);
conv= new Item_string(cstr.ptr(),cstr.length(),cstr.charset(),
- args[weak]->derivation());
+ args[weak]->collation.derivation);
((Item_string*)conv)->str_value.copy();
}
else
{
- conv= new Item_func_conv_charset(args[weak],args[strong]->charset());
- conv->collation.set(args[weak]->derivation());
+ conv= new Item_func_conv_charset(args[weak],args[strong]->collation.collation);
+ conv->collation.set(args[weak]->collation.derivation);
}
args[weak]= conv ? conv : args[weak];
}
@@ -730,13 +732,13 @@ Item_func_ifnull::val_str(String *str)
if (!args[0]->null_value)
{
null_value=0;
- res->set_charset(charset());
+ res->set_charset(collation.collation);
return res;
}
res=args[1]->val_str(str);
if ((null_value=args[1]->null_value))
return 0;
- res->set_charset(charset());
+ res->set_charset(collation.collation);
return res;
}
@@ -755,12 +757,12 @@ Item_func_if::fix_length_and_dec()
if (null1)
{
cached_result_type= arg2_type;
- set_charset(args[2]->charset());
+ collation.set(args[2]->collation.collation);
}
else if (null2)
{
cached_result_type= arg1_type;
- set_charset(args[1]->charset());
+ collation.set(args[1]->collation.collation);
}
else
{
@@ -772,7 +774,7 @@ Item_func_if::fix_length_and_dec()
}
else
{
- set_charset(&my_charset_bin); // Number
+ collation.set(&my_charset_bin); // Number
}
}
}
@@ -802,7 +804,7 @@ Item_func_if::val_str(String *str)
Item *arg= args[0]->val_int() ? args[1] : args[2];
String *res=arg->val_str(str);
if (res)
- res->set_charset(charset());
+ res->set_charset(collation.collation);
null_value=arg->null_value;
return res;
}
@@ -1187,7 +1189,7 @@ void in_string::set(uint pos,Item *item)
if (!str->charset())
{
CHARSET_INFO *cs;
- if (!(cs= item->charset()))
+ if (!(cs= item->collation.collation))
cs= &my_charset_bin; // Should never happen for STR items
str->set_charset(cs);
}
@@ -1265,7 +1267,7 @@ cmp_item* cmp_item::get_comparator(Item *item)
{
switch (item->result_type()) {
case STRING_RESULT:
- return new cmp_item_sort_string(item->charset());
+ return new cmp_item_sort_string(item->collation.collation);
break;
case INT_RESULT:
return new cmp_item_int;
@@ -1846,7 +1848,7 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
We could also do boyer-more for non-const items, but as we would have to
recompute the tables for each row it's not worth it.
*/
- if (args[1]->const_item() && !use_strnxfrm(charset()) &&
+ if (args[1]->const_item() && !use_strnxfrm(collation.collation) &&
!(specialflag & SPECIAL_NO_NEW_FUNC))
{
String* res2 = args[1]->val_str(&tmp_value2);
@@ -1867,7 +1869,7 @@ bool Item_func_like::fix_fields(THD *thd, TABLE_LIST *tlist, Item ** ref)
{
const char* tmp = first + 1;
for (; *tmp != wild_many && *tmp != wild_one && *tmp != escape; tmp++) ;
- canDoTurboBM = (tmp == last) && !use_mb(args[0]->charset());
+ canDoTurboBM = (tmp == last) && !use_mb(args[0]->collation.collation);
}
if (canDoTurboBM)