MySQL Forums
Forum List  »  Quality Assurance

Re: Bug in calculations of UNSIGNED int
Posted by: Ben. H.
Date: January 22, 2008 07:11AM

As far 222-223 is not positive you should used a signed type to get good result.

Take a look at,

SELECT S91-223 FROM SPS;

+----------------------+
| S91-223 |
+----------------------+
| 18446744073709551615 |
+----------------------+

But you want -1?

So, use a signed smallint will not probably help, it will give you the right
solution. Note also this will cost 1 byte more per record, so as example for
about 1048576 records you take 1MB as much harddisk space, is really matter?

Options: ReplyQuote


Subject
Views
Written By
Posted
4042
January 18, 2008 05:47AM
Re: Bug in calculations of UNSIGNED int
2185
January 22, 2008 07:11AM


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.