diff options
author | Alexander Barkov <bar@mariadb.com> | 2020-07-29 22:29:43 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.com> | 2020-07-30 08:04:58 +0400 |
commit | 6d3186e326b20a2d8d01c8d071677aaba16350d2 (patch) | |
tree | b0e03d594cbfd22d4de4a4e8676fabcf5d0a6e3c /mysql-test/main/type_int.test | |
parent | 92499ae95ced000b064910d1a15705faa64cc88f (diff) | |
download | mariadb-git-6d3186e326b20a2d8d01c8d071677aaba16350d2.tar.gz |
MDEV-23323 Rounding functions return a wrong data type for a BIT, ENUM, SET argument
Implementing dedicated fixing methods:
- Type_handler_bit::Item_func_round_fix_length_and_dec()
- Type_handler_bit::Item_func_int_val_fix_length_and_dec()
- Type_handler_typelib::Item_func_round_fix_length_and_dec()
because the inherited methods did not work well.
Fixing:
- Type_handler_typelib::Item_func_int_val_fix_length_and_dec
It did not work well, because it used args[0]->max_length to
calculate the result data type. In case of ENUM and SET it was
not correct, because in FLOOR() and CEILING() context
ENUM and SET return not more than 5 digits (65535 is the biggest
possible value).
Misc:
- Changing the API of
Type_handler_bit::Bit_decimal_notation_int_digits(const Item *item)
to a more generic form:
Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits(uint nbits)
- Fixing Type_handler_bit::Bit_decimal_notation_int_digits_by_nbits() to
return the exact number of decimal digits for all nbits 1..64.
The old implementation was approximate.
This change gives better (more precise) data types.
Diffstat (limited to 'mysql-test/main/type_int.test')
0 files changed, 0 insertions, 0 deletions