Bug #47109 Bad working ABS function
Submitted: 3 Sep 2009 18:15 Modified: 3 Oct 2009 18:44
Reporter: Alex Ching Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.1 OS:Windows
Assigned to: CPU Architecture:Any
Tags: ABS

[3 Sep 2009 18:15] Alex Ching
Description:
Look at the results of this
select
  sminute,
  abs(14 - 17) 'm',
  abs(sminute - 32) 'dm32',
  abs(sminute-35) 'm35',
  abs(sminute-36) 'm36',
  abs(36-sminute) '36m',
  abs(47-sminute) '47m',
  sign(sminute-36)*(sminute-36) sign_abs
from foundtr

=========================
35, 3, 3, 18446744073709551615, 1, 18446744073709551615
35, 3, 3, 18446744073709551615, 1, 18446744073709551615
34, 3, 2, 18446744073709551614, 2, 18446744073709551614
34, 3, 2, 18446744073709551614, 2, 18446744073709551614
34, 3, 2, 18446744073709551614, 2, 18446744073709551614
34, 3, 2, 18446744073709551614, 2, 18446744073709551614
35, 3, 3, 18446744073709551615, 1, 18446744073709551615
33, 3, 1, 18446744073709551613, 3, 18446744073709551613
33, 3, 1, 18446744073709551613, 3, 18446744073709551613
35, 3, 3, 18446744073709551615, 1, 18446744073709551615
33, 3, 1, 18446744073709551613, 3, 18446744073709551613
35, 3, 3, 18446744073709551615, 1, 18446744073709551615
33, 3, 1, 18446744073709551613, 3, 18446744073709551613
33, 3, 1, 18446744073709551613, 3, 18446744073709551613
35, 3, 3, 18446744073709551615, 1, 18446744073709551615
35, 3, 3, 18446744073709551615, 1, 18446744073709551615

How to repeat:
i've a table foundtr with sminute column.
sminute could be all integers betwee 1 and 60

Suggested fix:
ABS function isn't really work. The same is with using SIGN instead
[3 Sep 2009 18:44] Valeriy Kravchuk
Thank you for the problem report. Please, send the results of:

show create table foundtr\G
select version();
[3 Oct 2009 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".