projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
6db0275
)
fix unnecessary warnings on upgrade of remote Pg RADIUS db, RT#9178
author
ivan
<ivan>
Wed, 28 Jul 2010 02:46:39 +0000
(
02:46
+0000)
committer
ivan
<ivan>
Wed, 28 Jul 2010 02:46:39 +0000
(
02:46
+0000)
FS/FS/Upgrade.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Upgrade.pm
b/FS/FS/Upgrade.pm
index
62eda58
..
b5c8ff1
100644
(file)
--- a/
FS/FS/Upgrade.pm
+++ b/
FS/FS/Upgrade.pm
@@
-196,21
+196,26
@@
sub upgrade_sqlradius {
if ( $sth_index ) {
unless ( $sth_index->execute ) {
my $error = $sth_index->errstr;
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;
}
} 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'
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;
GROUP BY $group
")
or die $errmsg.$dbh->errstr;