From 146c990eb69167f7df2ef077636a02d7dc31d8bd Mon Sep 17 00:00:00 2001 From: Rsl1122 Date: Sat, 21 Sep 2019 10:34:38 +0300 Subject: [PATCH] Attempt to fix duplicate players on Players table --- .../database/queries/objects/NetworkTablePlayersQuery.java | 4 ++-- .../database/queries/objects/ServerTablePlayersQuery.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/NetworkTablePlayersQuery.java b/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/NetworkTablePlayersQuery.java index e65d6aa1e..355d79f2e 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/NetworkTablePlayersQuery.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/NetworkTablePlayersQuery.java @@ -67,7 +67,7 @@ public class NetworkTablePlayersQuery implements Query> { GROUP_BY + GeoInfoTable.USER_UUID; String selectLatestGeolocations = SELECT + "g1." + GeoInfoTable.GEOLOCATION + ',' + - "g1." + GeoInfoTable.USER_UUID + + DISTINCT + "g1." + GeoInfoTable.USER_UUID + FROM + "(" + selectGeolocations + ") AS g1" + INNER_JOIN + "(" + selectLatestGeolocationDate + ") AS g2 ON g1.uuid = g2.uuid" + WHERE + GeoInfoTable.LAST_USED + "=last_used_g"; @@ -84,7 +84,7 @@ public class NetworkTablePlayersQuery implements Query> { WHERE + UserInfoTable.BANNED + "=?"; String selectBaseUsers = SELECT + - "u." + UsersTable.USER_UUID + ',' + + DISTINCT + "u." + UsersTable.USER_UUID + ',' + "u." + UsersTable.USER_NAME + ',' + "u." + UsersTable.REGISTERED + ',' + "ban." + UserInfoTable.USER_UUID + " as banned," + diff --git a/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/ServerTablePlayersQuery.java b/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/ServerTablePlayersQuery.java index 84b7f42c5..195e27172 100644 --- a/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/ServerTablePlayersQuery.java +++ b/Plan/common/src/main/java/com/djrapitops/plan/storage/database/queries/objects/ServerTablePlayersQuery.java @@ -69,7 +69,7 @@ public class ServerTablePlayersQuery implements Query> { GROUP_BY + GeoInfoTable.USER_UUID; String selectLatestGeolocations = SELECT + "g1." + GeoInfoTable.GEOLOCATION + ',' + - "g1." + GeoInfoTable.USER_UUID + + DISTINCT + "g1." + GeoInfoTable.USER_UUID + FROM + "(" + selectGeolocations + ") AS g1" + INNER_JOIN + "(" + selectLatestGeolocationDate + ") AS g2 ON g1.uuid = g2.uuid" + WHERE + GeoInfoTable.LAST_USED + "=last_used_g"; @@ -83,7 +83,7 @@ public class ServerTablePlayersQuery implements Query> { GROUP_BY + "s." + SessionsTable.USER_UUID; String selectBaseUsers = SELECT + - "u." + UsersTable.USER_UUID + ',' + + DISTINCT + "u." + UsersTable.USER_UUID + ',' + "u." + UsersTable.USER_NAME + ',' + "u." + UsersTable.REGISTERED + ',' + UserInfoTable.BANNED + ',' +