Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
-
10.9.4
-
None
-
mariadb docker
Description
We found that problems also occur when we use the mod function, the division function and two extremal functions together
select least('0'/-4,0/-4); – -0
select greatest('0'/-4,0/-4); – 0
select least(mod('-12',-4),mod(-12,-4)); – -0
select Greatest(mod('-12',-4),mod(-12,-4)); – 0
We tested the following two use cases
select mod('-12',-4) = mod(-12,-4); – 1
select '0'/-4 = 0/4; – 1
These two use cases prove that the two calculation results are equal. We hope that the extreme value function can give the same result, because the operation process of these two extreme value functions should also be the ultimate result of the comparison operator.
Although the result of the internal mod function or division function is incorrect, we think that the extreme value function should eliminate the influence of the negative number representation and give the correct answer.
MySQL has verified this as a bug. please see https://bugs.mysql.com/bug.php?id=109842. so I consider it also a bug for mariadb.
Attachments
Issue Links
- duplicates
-
MDEV-6856 <negative value> MOD <fractional divisor> returns negative zero
- Open