mirror of
https://github.com/MariaDB/server.git
synced 2026-04-27 10:45:30 +02:00
Bug #19372926 : 5.5.38 FAILS FUNC_MATH MTR TEST.
Issue : ------- This seems for some platform -(LONGLONG_MIN) is not flagged as out of range. Fix: ---- Fix is backported from mysql-5.6 bug 14314156. Fixed by adding an explicit test for this value in Item_func_neg::int_op().
This commit is contained in:
parent
ff906f032f
commit
c5dfdec568
2 changed files with 10 additions and 3 deletions
|
|
@ -1760,7 +1760,13 @@ longlong Item_func_neg::int_op()
|
|||
if ((null_value= args[0]->null_value))
|
||||
return 0;
|
||||
if (args[0]->unsigned_flag &&
|
||||
(ulonglong) value > (ulonglong) LONGLONG_MAX + 1)
|
||||
(ulonglong) value > (ulonglong) LONGLONG_MAX + 1ULL)
|
||||
return raise_integer_overflow();
|
||||
// For some platforms we need special handling of LONGLONG_MIN to
|
||||
// guarantee overflow.
|
||||
if (value == LONGLONG_MIN &&
|
||||
!args[0]->unsigned_flag &&
|
||||
!unsigned_flag)
|
||||
return raise_integer_overflow();
|
||||
return check_integer_overflow(-value, !args[0]->unsigned_flag && value < 0);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue