Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0

into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug17047


sql/item_strfunc.cc:
  Auto merged
mysql-test/r/func_str.result:
  Manual merge.
mysql-test/t/func_str.test:
  Manual merge.
This commit is contained in:
unknown 2006-11-16 14:19:37 +03:00
commit a4823607f9
7 changed files with 79 additions and 5 deletions

View file

@ -2465,7 +2465,6 @@ void Item_func_in::fix_length_and_dec()
if (cmp_type == STRING_RESULT)
in_item->cmp_charset= cmp_collation.collation;
}
maybe_null= args[0]->maybe_null;
max_length= 1;
}

View file

@ -80,6 +80,20 @@ String *Item_str_func::check_well_formed_result(String *str)
}
bool Item_str_func::fix_fields(THD *thd, Item **ref)
{
bool res= Item_func::fix_fields(thd, ref);
/*
In Item_str_func::check_well_formed_result() we may set null_value
flag on the same condition as in test() below.
*/
maybe_null= (maybe_null ||
test(thd->variables.sql_mode &
(MODE_STRICT_TRANS_TABLES | MODE_STRICT_ALL_TABLES)));
return res;
}
my_decimal *Item_str_func::val_decimal(my_decimal *decimal_value)
{
DBUG_ASSERT(fixed == 1);

View file

@ -37,6 +37,7 @@ public:
enum Item_result result_type () const { return STRING_RESULT; }
void left_right_max_length();
String *check_well_formed_result(String *str);
bool fix_fields(THD *thd, Item **ref);
};
class Item_func_md5 :public Item_str_func
@ -525,9 +526,8 @@ public:
{ collation.set(cs); }
String *val_str(String *);
void fix_length_and_dec()
{
maybe_null=0;
max_length=arg_count * collation.collation->mbmaxlen;
{
max_length= arg_count * collation.collation->mbmaxlen;
}
const char *func_name() const { return "char"; }
};