where varcharcol = 0 returns all rows
This is caused MySQL's sloppy data type checking. As far as I know there is no workaround, except to write correct SQL. 

In general it is highly recommended to never rely on implicit data type conversion. Make sure your literals match the datatype of the column. 

So you should write:

select * from mytable where colb = '0';