Use getDouble with SQL function AVG()

MySQL that restricts float being queried with getLong caused an
SQLException

All usages of getLong with AVG function replaced with
getDouble cast to long.

Affects issues:
- Fixed #1181
This commit is contained in:
Rsl1122 2019-10-19 12:42:25 +03:00
parent 68c845e71b
commit 549cad4da5
4 changed files with 15 additions and 15 deletions

View File

@ -292,7 +292,7 @@ public class ActivityIndexQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -326,7 +326,7 @@ public class ActivityIndexQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -361,7 +361,7 @@ public class ActivityIndexQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};

View File

@ -282,7 +282,7 @@ public class NetworkActivityIndexQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -314,7 +314,7 @@ public class NetworkActivityIndexQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -347,7 +347,7 @@ public class NetworkActivityIndexQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};

View File

@ -616,7 +616,7 @@ public class SessionQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -644,7 +644,7 @@ public class SessionQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -677,7 +677,7 @@ public class SessionQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -705,7 +705,7 @@ public class SessionQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};
@ -738,7 +738,7 @@ public class SessionQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : 0;
return set.next() ? (long) set.getDouble("average") : 0;
}
});
};

View File

@ -333,7 +333,7 @@ public class TPSQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : -1L;
return set.next() ? (long) set.getDouble("average") : -1L;
}
};
}
@ -353,7 +353,7 @@ public class TPSQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : -1L;
return set.next() ? (long) set.getDouble("average") : -1L;
}
};
}
@ -373,7 +373,7 @@ public class TPSQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : -1L;
return set.next() ? (long) set.getDouble("average") : -1L;
}
};
}
@ -433,7 +433,7 @@ public class TPSQueries {
@Override
public Long processResults(ResultSet set) throws SQLException {
return set.next() ? set.getLong("average") : -1L;
return set.next() ? (long) set.getDouble("average") : -1L;
}
};
}