[freeside-commits] freeside/FS/FS Upgrade.pm,1.39,1.40
Ivan,,,
ivan at wavetail.420.am
Tue Jul 27 19:46:56 PDT 2010
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv13941
Modified Files:
Upgrade.pm
Log Message:
fix unnecessary warnings on upgrade of remote Pg RADIUS db, RT#9178
Index: Upgrade.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Upgrade.pm,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -w -d -r1.39 -r1.40
--- Upgrade.pm 25 Jul 2010 20:44:23 -0000 1.39
+++ Upgrade.pm 28 Jul 2010 02:46:54 -0000 1.40
@@ -212,21 +212,26 @@
if ( $sth_index ) {
unless ( $sth_index->execute ) {
my $error = $sth_index->errstr;
- warn $errmsg.$error unless $error =~ /Duplicate key name/i;
+ warn $errmsg.$error
+ unless $error =~ /Duplicate key name/i #mysql
+ || $error =~ /relation "freesidestatus" already exists/i; #Pg
}
} else {
my $error = $dbh->errstr;
- warn $errmsg.$error; #unless $error =~ /exists/i;
+ warn $errmsg.$error. ' (preparing statement)';#unless $error =~ /exists/i;
}
+ my $times = ($dbh->{Driver}->{Name} =~ /^mysql/)
+ ? ' AcctStartTime != 0 AND AcctStopTime != 0 '
+ : ' AcctStartTime IS NOT NULL AND AcctStopTime IS NOT NULL ';
+
my $sth = $dbh->prepare("SELECT UserName,
Realm,
$str2time max(AcctStartTime)),
$str2time max(AcctStopTime))
FROM radacct
WHERE FreesideStatus = 'done'
- AND AcctStartTime != 0
- AND AcctStopTime != 0
+ AND $times
GROUP BY $group
")
or die $errmsg.$dbh->errstr;
More information about the freeside-commits
mailing list