mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
A cleanup for the patch for MDEV-12852, MDEV-12853, MDEV-12869
The patch broke expressions like CAST(1.0e+300 AS SIGNED INT) in binary protocol, e.g.: mtr --ps cast Short real numbers like 1.0e+300 can return huge values, so using args[0]->max_length is not reliable to choose properly the result type for Item_func_signed and Item_func_unsigned (between INT and BIGINT). Setting Item_[un]signed_typecast::max_length to MAX_BIGINT_WIDTH when doing CAST from FLOAT/DOUBLE, to force type_handler() return &type_handler_longlong rather than &type_handler_long.
This commit is contained in:
@ -4214,6 +4214,21 @@ bool Type_handler_string_result::
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Type_handler_real_result::
|
||||
Item_func_signed_fix_length_and_dec(Item_func_signed *item) const
|
||||
{
|
||||
item->fix_length_and_dec_double();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Type_handler_real_result::
|
||||
Item_func_unsigned_fix_length_and_dec(Item_func_unsigned *item) const
|
||||
{
|
||||
item->fix_length_and_dec_double();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool Type_handler::
|
||||
Item_double_typecast_fix_length_and_dec(Item_double_typecast *item) const
|
||||
|
Reference in New Issue
Block a user