The code in this method:
is not friendly to pluggable data types, as it tests for result_type().
Pluggable data types may want to implement a different way for boolean conversion.
Under terms of this task will add new methods in Type_handler:
and split the mentioned code into virtual implementations for relevant Type_handler_xxx classes.