Mysql – String comparison with integer is not working sometimes in MySQL 5.5

MySQLmysql-5.5

I have upgraded MySQL to version 5.5. Before upgrading when we used string comparison with integer, it was working.

Code is "value = 1", here 'value' is declared as varchar(45) and its value can be anything either 1 or some string.

But after upgrading, it is not working properly. Sometimes it works fine and sometimes not. I tested in different setups, in some setups it is working but in some other it is failing.

Here if I change the code as value = '-1', then it is working fine in all cases and different setups.

But I had used this case in my application in many places.

Is there anything to be handled for newer version other than using single quotes?

Please help me out of this.

Best Answer

This isn't a full answer but you might try looking over the 5.5 change list starting at http://dev.mysql.com/doc/refman/5.5/en/news-5-5-0.html

Note the section nav on the right that goes subversion by subversion. Skim through each looking at "incompatible changes". If you find something describing what you are seeing it will at least give you better context of what is happening and why.