Bug #42933 Wrong Primary key
Submitted: 17 Feb 2009 14:49 Modified: 17 Feb 2009 17:02
Reporter: Cristian Rossi Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: FULLTEXT search Severity:S2 (Serious)
Version:5.0 OS:Linux
Assigned to: CPU Architecture:Any

[17 Feb 2009 14:49] Cristian Rossi
Description:
When selecting a primarykey id(int(11), primarykey) if the parameter is passed as a string mysql will use the first full integer part and ignore the rest, which I didn't expect to happen.

SELECT * FROM contacts WHERE id = '20401'

produces the same results as 

SELECT * FROM contacts WHERE id = '20401asiuhdasuihd123763hffhduifh57495gjodfjgfoidgjgjiroij05685068450689'

How to repeat:
Simply do a select statement on a table with a integer primarykey.

Suggested fix:
dunno
[17 Feb 2009 17:02] Valeriy Kravchuk
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/refman/5.0/en/type-conversion.html and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php