mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2025-03-07 17:28:03 +08:00
Use getDouble with SQL function AVG()
MySQL that restricts float being queried with getInt caused an SQLException All usages of getInt with AVG function replaced with getDouble cast to int. Affects issues: - Fixed #1181
This commit is contained in:
parent
55401c86c1
commit
68c845e71b
@ -231,7 +231,7 @@ public class PlayerCountQueries {
|
||||
|
||||
@Override
|
||||
public Integer processResults(ResultSet set) throws SQLException {
|
||||
return set.next() ? set.getInt("average") : 0;
|
||||
return set.next() ? (int) set.getDouble("average") : 0;
|
||||
}
|
||||
});
|
||||
};
|
||||
@ -389,7 +389,7 @@ public class PlayerCountQueries {
|
||||
|
||||
@Override
|
||||
public Integer processResults(ResultSet set) throws SQLException {
|
||||
return set.next() ? set.getInt("average") : 0;
|
||||
return set.next() ? (int) set.getDouble("average") : 0;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
@ -234,7 +234,7 @@ public class PingQueries {
|
||||
serverUUID,
|
||||
set.getInt("minPing"),
|
||||
set.getInt("maxPing"),
|
||||
set.getInt("avgPing")
|
||||
(int) set.getDouble("avgPing")
|
||||
);
|
||||
pingByGeolocation.put(set.getString(GeoInfoTable.GEOLOCATION), ping);
|
||||
}
|
||||
@ -285,7 +285,7 @@ public class PingQueries {
|
||||
null,
|
||||
set.getInt("minPing"),
|
||||
set.getInt("maxPing"),
|
||||
set.getInt("avgPing")
|
||||
(int) set.getDouble("avgPing")
|
||||
);
|
||||
pingByGeolocation.put(set.getString(GeoInfoTable.GEOLOCATION), ping);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user