diff options
Diffstat (limited to 'sql/item.cc')
-rw-r--r-- | sql/item.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/sql/item.cc b/sql/item.cc index 3daf1e8393e..62c5bdb23b6 100644 --- a/sql/item.cc +++ b/sql/item.cc @@ -3783,6 +3783,7 @@ void Item_param::set_int(longlong i, uint32 max_length_arg) DBUG_ENTER("Item_param::set_int"); value.integer= (longlong) i; state= INT_VALUE; + collation.set_numeric(); max_length= max_length_arg; decimals= 0; maybe_null= 0; @@ -3795,6 +3796,7 @@ void Item_param::set_double(double d) DBUG_ENTER("Item_param::set_double"); value.real= d; state= REAL_VALUE; + collation.set_numeric(); max_length= DBL_DIG + 8; decimals= NOT_FIXED_DEC; maybe_null= 0; @@ -3824,6 +3826,7 @@ void Item_param::set_decimal(const char *str, ulong length) str2my_decimal(E_DEC_FATAL_ERROR, str, &decimal_value, &end); state= DECIMAL_VALUE; decimals= decimal_value.frac; + collation.set_numeric(); max_length= my_decimal_precision_to_length_no_truncation(decimal_value.precision(), decimals, unsigned_flag); @@ -3839,6 +3842,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg) my_decimal2decimal(dv, &decimal_value); decimals= (uint8) decimal_value.frac; + collation.set_numeric(); unsigned_flag= unsigned_arg; max_length= my_decimal_precision_to_length(decimal_value.intg + decimals, decimals, unsigned_flag); @@ -3849,6 +3853,7 @@ void Item_param::set_decimal(const my_decimal *dv, bool unsigned_arg) void Item_param::fix_temporal(uint32 max_length_arg, uint decimals_arg) { state= TIME_VALUE; + collation.set_numeric(); max_length= max_length_arg; decimals= decimals_arg; fix_type(Item::DATE_ITEM); @@ -4579,6 +4584,7 @@ Item_param::set_value(THD *thd, sp_rcontext *ctx, Item **it) } null_value= FALSE; + unsigned_flag= arg->unsigned_flag; switch (arg->result_type()) { case STRING_RESULT: |