Re: Strange behavior with integer unsigned type...

2005-12-30 Thread Gleb Paharenko
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

Re: Strange behavior with integer unsigned type...

2005-12-30 Thread Stephen Cook
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

Re: Strange behavior with integer unsigned type...

2005-12-24 Thread Marko Domanovic
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:

Strange behavior with integer unsigned type...

2005-12-23 Thread Marko Domanovic
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,

Re: Strange behavior with integer unsigned type...

2005-12-23 Thread Gleb Paharenko
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

Re: Strange behavior with integer unsigned type...

2005-12-23 Thread James Harvard
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