In the following query:
select count(1) from main_territory where code = true
union all
select count(1) from main_territory where code = false;
-------------------------------------------------------------------
count(1)
0
250
Why does putting 0 or false make the query return all rows?
It doesn't matter what the data is, but here's a sample:
CREATE TABLE z_tmp (x varchar(11));
insert into z_tmp values ('x'); -- note this is not a Boolean
select count(1) from z_tmp where x=true union all select count(1) from z_tmp where x=false;
Note: I'm using mysql5.7.