MySQL Forums
Forum List  »  Quality Assurance

Re: Is this a bug?
Posted by: David Shrewsbury
Date: January 02, 2007 12:38PM

Not a bug. It's because you are using the UNSIGNED attribute on the columns that you are subtracting.
mysql> SELECT -1/1;
+---------+
| -1/1    |
+---------+
| -1.0000 | 
+---------+
1 row in set (0.00 sec)

mysql> SELECT CAST(-1 AS UNSIGNED) / 1;
+---------------------------+
| CAST(-1 AS UNSIGNED) / 1  |
+---------------------------+
| 18446744073709551615.0000 | 
+---------------------------+
1 row in set (0.00 sec)
-Dave



Edited 1 time(s). Last edit at 01/02/2007 12:40PM by David Shrewsbury.

Options: ReplyQuote


Subject
Views
Written By
Posted
4946
January 02, 2007 11:32AM
Re: Is this a bug?
3050
January 02, 2007 12:38PM
2752
July 19, 2007 06:04AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.