diff --git a/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/ServerAggregateQueries.java b/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/ServerAggregateQueries.java index b8e5df884..53133a9dc 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/ServerAggregateQueries.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/db/access/queries/ServerAggregateQueries.java @@ -88,7 +88,6 @@ public class ServerAggregateQueries { */ public static Query> serverUserCounts() { String sql = "SELECT COUNT(1) as c, " + UserInfoTable.SERVER_UUID + FROM + UserInfoTable.TABLE_NAME + - WHERE + UserInfoTable.SERVER_UUID + "=?" + GROUP_BY + UserInfoTable.SERVER_UUID; return new QueryAllStatement>(sql, 100) { @Override diff --git a/Plan/common/src/test/java/com/djrapitops/plan/db/CommonDBTest.java b/Plan/common/src/test/java/com/djrapitops/plan/db/CommonDBTest.java index 50d68ce22..e78219923 100644 --- a/Plan/common/src/test/java/com/djrapitops/plan/db/CommonDBTest.java +++ b/Plan/common/src/test/java/com/djrapitops/plan/db/CommonDBTest.java @@ -1009,4 +1009,12 @@ public abstract class CommonDBTest { assertEquals("Wrong return value. " + tpsData.stream().map(TPS::getPlayers).collect(Collectors.toList()).toString(), expected, actual); } + @Test + public void playerCountForServersIsCorrect() { + Map expected = Collections.singletonMap(serverUUID, 1); + saveUserOne(); + + Map result = db.query(ServerAggregateQueries.serverUserCounts()); + assertEquals(expected, result); + } }