I noticed something strange today. Say you have a mysql table:
create table usr(
INSERT INTO usr (usr_id) VALUES ('1');
SELECT * FROM usr WHERE usr_id='1sfgfsdgs'
SELECT * FROM usr WHERE usr_id='1'
Well this is the page that has the dirt, http://dev.mysql.com/doc/refman/5.7/en/type-conversion.html
But it's clear as mud
When an operator is used with operands of different types, type conversion occurs to make the operands compatible. Some conversions occur implicitly. For example, MySQL automatically converts numbers to strings as necessary, and vice versa.
It does have a few examples that makes things a bit clearer
mysql> SELECT 1 > '6x'; -> 0 mysql> SELECT 7 > '6x'; -> 1 mysql> SELECT 0 > 'x6'; -> 0 mysql> SELECT 0 = 'x6'; -> 1
What this essentially means is that if a number is compared to an alpha numeric string and that string starts with a number all non numeric characters towards the end are discarded.
The fact that you use serial doesn't really have anything to do with this.