+=item condition_sql_option_integer OPTION [ DRIVER_NAME ]
+
+As I<condition_sql_option>, but cast the option value to an integer so that
+comparison to other integers is type-correct.
+
+=cut
+
+sub condition_sql_option_integer {
+ my ($class, $option, $driver_name) = @_;
+
+ my $integer = (driver_name() =~ /^mysql/) ? 'UNSIGNED INTEGER' : 'INTEGER';
+
+ 'CAST(
+ COALESCE('. $class->condition_sql_option($option).
+ " ,'0') ".
+ " AS $integer )";
+}
+
+=item condition_sql_option_money OPTION
+
+As I<condition_sql_option>, but cast the option value to DECIMAL so that
+comparison to other monetary values is type-correct.
+
+=cut
+
+sub condition_sql_option_money {
+ my ($class, $option ) = @_;
+
+ 'CAST(
+ COALESCE('. $class->condition_sql_option($option).
+ " ,'0') ".
+ " AS DECIMAL(10,2) )";
+}
+