summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2014-06-27 15:09:04 -0700
committerMark Wells <mark@freeside.biz>2014-06-27 15:09:04 -0700
commit6805930da094e93edb07c01f50a6a3c071d8ab5e (patch)
tree61a0d446a226fd8cef7c7781f05070476d625dd1
parent244d885992a061cd04765e0faf41d3185c582d75 (diff)
fix day_of_month condition on mysql, #28895
-rw-r--r--FS/FS/part_event/Condition/day_of_month.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/FS/FS/part_event/Condition/day_of_month.pm b/FS/FS/part_event/Condition/day_of_month.pm
index 61cd8d6d1..036cb7066 100644
--- a/FS/FS/part_event/Condition/day_of_month.pm
+++ b/FS/FS/part_event/Condition/day_of_month.pm
@@ -29,7 +29,11 @@ sub condition_sql {
my( $class, $table, %opt ) = @_;
my $today = (localtime($opt{'time'}))[3];
my $day = $class->condition_sql_option('day');
- "$today = ANY( string_to_array($day, ',')::integer[] )"
+ if ($opt{'driver_name'} eq 'Pg') {
+ "$today = ANY( string_to_array($day, ',')::integer[] )";
+ } elsif ( $opt{'driver_name'} eq 'mysql' ) {
+ "find_in_set($today, $day) > 0";
+ }
}
1;