From: Mark Wells Date: Fri, 27 Jun 2014 22:08:49 +0000 (-0700) Subject: fix day_of_month condition on mysql, #28895 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=223baf5004076bc4bc67c8c5ac48b35d3d00a171 fix day_of_month condition on mysql, #28895 --- 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;