Hello.
That seems like a bug:
http://bugs.mysql.com/bug.php?id=14543
Marko Domanovic wrote:
mysql 5.0.15-standard
UPDATE table SET fieldname = fieldname-1
when the fieldname is 0 gives me 4294967295
fieldname is integer(10) unsigned...
maybe it would be more logical the
Maybe it is because I am a programmer, but (unsigned) 0 - 1 = 4294967295.
What's the big deal?
Gleb Paharenko wrote:
Hello.
That seems like a bug:
http://bugs.mysql.com/bug.php?id=14543
Marko Domanovic wrote:
mysql 5.0.15-standard
UPDATE table SET fieldname = fieldname-1
mysql 5.0.15-standard
UPDATE table SET fieldname = fieldname-1
when the fieldname is 0 gives me 4294967295
fieldname is integer(10) unsigned...
maybe it would be more logical the expression to evaluate as 0, insted 2^32
..
--
MySQL General Mailing List
For list archives:
I noticed rather interesting thing... If you deduct 1 from the 0 which is
stored in integer unsigned field, you get 2^32, not 0. I think that's how
things are not working with version 4, and want to ask is this behavior bug
or feature in mysql version 5, and is it customizable?
Greetings,
Hello.
On both 4.1.16 and 5.0.17 I've got the same results, however not 2^32,
but 18446744073709551615. 4.0 is deprecated and its results could be
different. Please provide exact SQL statement which you're using if you
still think that MySQL behaves weirdly with unsigned integers. In the
I don't think that this behaviour is very surprising. If you carry out a
mathmaticical operation that returns a result outside the data type's range
then it _must_ give you an incorrect result. The only alternative would be to
throw an error.
I know that the manual documents that after an