Fix incorrect SQL values for boolean fields

fixes #8100