mirror of
https://github.com/MariaDB/server.git
synced 2026-04-29 19:55:32 +02:00
Merge 5.5
This commit is contained in:
commit
70ed67e1cc
442 changed files with 7332 additions and 5917 deletions
|
|
@ -507,7 +507,10 @@ bool Item_func::is_expensive_processor(uchar *arg)
|
|||
my_decimal *Item_func::val_decimal(my_decimal *decimal_value)
|
||||
{
|
||||
DBUG_ASSERT(fixed);
|
||||
int2my_decimal(E_DEC_FATAL_ERROR, val_int(), unsigned_flag, decimal_value);
|
||||
longlong nr= val_int();
|
||||
if (null_value)
|
||||
return 0; /* purecov: inspected */
|
||||
int2my_decimal(E_DEC_FATAL_ERROR, nr, unsigned_flag, decimal_value);
|
||||
return decimal_value;
|
||||
}
|
||||
|
||||
|
|
@ -2090,9 +2093,10 @@ void Item_func_integer::fix_length_and_dec()
|
|||
|
||||
void Item_func_int_val::fix_num_length_and_dec()
|
||||
{
|
||||
max_length= args[0]->max_length - (args[0]->decimals ?
|
||||
args[0]->decimals + 1 :
|
||||
0) + 2;
|
||||
ulonglong tmp_max_length= (ulonglong ) args[0]->max_length -
|
||||
(args[0]->decimals ? args[0]->decimals + 1 : 0) + 2;
|
||||
max_length= tmp_max_length > (ulonglong) 4294967295U ?
|
||||
(uint32) 4294967295U : (uint32) tmp_max_length;
|
||||
uint tmp= float_length(decimals);
|
||||
set_if_smaller(max_length,tmp);
|
||||
decimals= 0;
|
||||
|
|
@ -2535,7 +2539,8 @@ void Item_func_min_max::fix_length_and_dec()
|
|||
}
|
||||
if (cmp_type == STRING_RESULT)
|
||||
{
|
||||
agg_arg_charsets_for_comparison(collation, args, arg_count);
|
||||
agg_arg_charsets_for_string_result_with_comparison(collation,
|
||||
args, arg_count);
|
||||
if (datetime_found)
|
||||
{
|
||||
thd= current_thd;
|
||||
|
|
@ -3005,6 +3010,8 @@ void Item_func_find_in_set::fix_length_and_dec()
|
|||
String *find=args[0]->val_str(&value);
|
||||
if (find)
|
||||
{
|
||||
// find is not NULL pointer so args[0] is not a null-value
|
||||
DBUG_ASSERT(!args[0]->null_value);
|
||||
enum_value= find_type(((Field_enum*) field)->typelib,find->ptr(),
|
||||
find->length(), 0);
|
||||
enum_bit=0;
|
||||
|
|
@ -3023,11 +3030,22 @@ longlong Item_func_find_in_set::val_int()
|
|||
DBUG_ASSERT(fixed == 1);
|
||||
if (enum_value)
|
||||
{
|
||||
ulonglong tmp=(ulonglong) args[1]->val_int();
|
||||
if (!(null_value=args[1]->null_value || args[0]->null_value))
|
||||
// enum_value is set iff args[0]->const_item() in fix_length_and_dec().
|
||||
DBUG_ASSERT(args[0]->const_item());
|
||||
|
||||
ulonglong tmp= (ulonglong) args[1]->val_int();
|
||||
null_value= args[1]->null_value;
|
||||
/*
|
||||
No need to check args[0]->null_value since enum_value is set iff
|
||||
args[0] is a non-null const item. Note: no DBUG_ASSERT on
|
||||
args[0]->null_value here because args[0] may have been replaced
|
||||
by an Item_cache on which val_int() has not been called. See
|
||||
BUG#11766317
|
||||
*/
|
||||
if (!null_value)
|
||||
{
|
||||
if (tmp & enum_bit)
|
||||
return enum_value;
|
||||
return enum_value;
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
|
@ -4254,6 +4272,7 @@ Item_func_set_user_var::fix_length_and_dec()
|
|||
fix_length_and_charset(args[0]->max_char_length(),
|
||||
args[0]->collation.collation);
|
||||
}
|
||||
unsigned_flag= args[0]->unsigned_flag;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue