1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-27 18:02:13 +03:00

MDEV-28001 greatest/least with bigint unsigned maxium has unexpected results compared to 0

LEAST() and GREATEST() erroneously calcucalted the result as signed
for BIGINT UNSIGNED arguments.

Adding a new method for unsigned arguments:
  Item_func_min_max::val_uint_native()
This commit is contained in:
Alexander Barkov
2024-11-11 12:50:56 +04:00
parent 74184074a0
commit ae0cbfe934
5 changed files with 40 additions and 1 deletions

View File

@ -6152,7 +6152,7 @@ longlong Type_handler_timestamp_common::
longlong Type_handler_numeric::
Item_func_min_max_val_int(Item_func_min_max *func) const
{
return func->val_int_native();
return is_unsigned() ? func->val_uint_native() : func->val_int_native();
}