Refactor the type casting of booleans in MySQL
Merge pull request #15339 from sgrif/sg-mysql-booleans

Refactor the type casting of booleans in MySQL