Fix typo in extension tab icon query

Affects issues:
- Fixed #2608
This commit is contained in:
Aurora Lahtela 2022-09-25 11:21:44 +03:00
parent 011ce7751d
commit ccc6861df6
9 changed files with 20 additions and 12 deletions

View File

@ -100,7 +100,7 @@ public class ExtensionAggregateBooleansQuery implements Query<Map<Integer, Exten
LEFT_JOIN + '(' + selectTrueBooleans + ") b2 on b2." + ExtensionPlayerValueTable.PROVIDER_ID + "=b1." + ExtensionPlayerValueTable.PROVIDER_ID + LEFT_JOIN + '(' + selectTrueBooleans + ") b2 on b2." + ExtensionPlayerValueTable.PROVIDER_ID + "=b1." + ExtensionPlayerValueTable.PROVIDER_ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPluginTable.SERVER_UUID + "=?" + WHERE + ExtensionPluginTable.SERVER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?"; AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

View File

@ -99,7 +99,7 @@ public class ExtensionAggregateDoublesQuery implements Query<Map<Integer, Extens
LEFT_JOIN + '(' + selectDoubleAverage + ") b2 on b2." + ExtensionPlayerValueTable.PROVIDER_ID + "=b1." + ExtensionPlayerValueTable.PROVIDER_ID + LEFT_JOIN + '(' + selectDoubleAverage + ") b2 on b2." + ExtensionPlayerValueTable.PROVIDER_ID + "=b1." + ExtensionPlayerValueTable.PROVIDER_ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPluginTable.SERVER_UUID + "=?" + WHERE + ExtensionPluginTable.SERVER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?"; AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

View File

@ -87,7 +87,7 @@ public class ExtensionAggregateGroupsQuery implements Query<Map<Integer, Extensi
INNER_JOIN + ExtensionPluginTable.TABLE_NAME + " e1 on p1." + ExtensionProviderTable.PLUGIN_ID + "=e1." + ExtensionPluginTable.ID + INNER_JOIN + ExtensionPluginTable.TABLE_NAME + " e1 on p1." + ExtensionProviderTable.PLUGIN_ID + "=e1." + ExtensionPluginTable.ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPluginTable.SERVER_UUID + "=?" + WHERE + ExtensionPluginTable.SERVER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" + AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" +
ORDER_BY + "table_id ASC, group_name ASC"; ORDER_BY + "table_id ASC, group_name ASC";

View File

@ -101,7 +101,7 @@ public class ExtensionAggregateNumbersQuery implements Query<Map<Integer, Extens
LEFT_JOIN + '(' + selectNumberAverage + ") b2 on b2." + ExtensionPlayerValueTable.PROVIDER_ID + "=b1." + ExtensionPlayerValueTable.PROVIDER_ID + LEFT_JOIN + '(' + selectNumberAverage + ") b2 on b2." + ExtensionPlayerValueTable.PROVIDER_ID + "=b1." + ExtensionPlayerValueTable.PROVIDER_ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPluginTable.SERVER_UUID + "=?" + WHERE + ExtensionPluginTable.SERVER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" + AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" +
AND + "p1." + ExtensionProviderTable.FORMAT_TYPE + "!=?" + AND + "p1." + ExtensionProviderTable.FORMAT_TYPE + "!=?" +

View File

@ -90,7 +90,7 @@ public class ExtensionAggregatePercentagesQuery implements Query<Map<Integer, Ex
INNER_JOIN + ExtensionPluginTable.TABLE_NAME + " e1 on p1." + ExtensionProviderTable.PLUGIN_ID + "=e1." + ExtensionPluginTable.ID + INNER_JOIN + ExtensionPluginTable.TABLE_NAME + " e1 on p1." + ExtensionProviderTable.PLUGIN_ID + "=e1." + ExtensionPluginTable.ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPluginTable.SERVER_UUID + "=?" + WHERE + ExtensionPluginTable.SERVER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?"; AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

View File

@ -133,7 +133,7 @@ public class ExtensionPlayerDataQuery implements Query<Map<ServerUUID, List<Exte
INNER_JOIN + ExtensionProviderTable.TABLE_NAME + " p1 on p1." + ExtensionProviderTable.ID + "=v1." + ExtensionPlayerValueTable.PROVIDER_ID + INNER_JOIN + ExtensionProviderTable.TABLE_NAME + " p1 on p1." + ExtensionProviderTable.ID + "=v1." + ExtensionPlayerValueTable.PROVIDER_ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPlayerValueTable.USER_UUID + "=?" + WHERE + ExtensionPlayerValueTable.USER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?"; AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

View File

@ -81,7 +81,7 @@ public class ExtensionPlayerGroupsQuery implements Query<Map<Integer, ExtensionD
INNER_JOIN + ExtensionProviderTable.TABLE_NAME + " p1 on p1." + ExtensionProviderTable.ID + "=v1." + ExtensionPlayerValueTable.PROVIDER_ID + INNER_JOIN + ExtensionProviderTable.TABLE_NAME + " p1 on p1." + ExtensionProviderTable.ID + "=v1." + ExtensionPlayerValueTable.PROVIDER_ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionGroupsTable.USER_UUID + "=?" + WHERE + ExtensionGroupsTable.USER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" + AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" +
ORDER_BY + ExtensionGroupsTable.GROUP_NAME + " ASC"; ORDER_BY + ExtensionGroupsTable.GROUP_NAME + " ASC";

View File

@ -136,7 +136,7 @@ public class ExtensionServerDataQuery implements Query<List<ExtensionData>> {
INNER_JOIN + ExtensionPluginTable.TABLE_NAME + " e1 on p1." + ExtensionProviderTable.PLUGIN_ID + "=e1." + ExtensionPluginTable.ID + INNER_JOIN + ExtensionPluginTable.TABLE_NAME + " e1 on p1." + ExtensionProviderTable.PLUGIN_ID + "=e1." + ExtensionPluginTable.ID +
LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID + LEFT_JOIN + ExtensionTabTable.TABLE_NAME + " t1 on t1." + ExtensionTabTable.ID + "=p1." + ExtensionProviderTable.TAB_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i1 on i1." + ExtensionIconTable.ID + "=p1." + ExtensionProviderTable.ICON_ID +
LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=p1." + ExtensionTabTable.ICON_ID + LEFT_JOIN + ExtensionIconTable.TABLE_NAME + " i2 on i2." + ExtensionIconTable.ID + "=t1." + ExtensionTabTable.ICON_ID +
WHERE + ExtensionPluginTable.SERVER_UUID + "=?" + WHERE + ExtensionPluginTable.SERVER_UUID + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?"; AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

View File

@ -107,14 +107,22 @@ public class SessionJoinAddressPatch extends Patch {
} }
private void populateLatestSessions() { private void populateLatestSessions() {
String sql = SELECT + String selectLatestSessionIds = SELECT +
"MAX(s." + SessionsTable.ID + ") as session_id," + "MAX(s." + SessionsTable.ID + ") as session_id," +
"j." + JoinAddressTable.ID + " as join_address_id" + "u." + UserInfoTable.USER_ID + ',' +
"u." + UserInfoTable.SERVER_ID + ',' +
"u." + UserInfoTable.JOIN_ADDRESS +
FROM + UserInfoTable.TABLE_NAME + " u" + FROM + UserInfoTable.TABLE_NAME + " u" +
INNER_JOIN + SessionsTable.TABLE_NAME + " s on s." + SessionsTable.USER_ID + "=u." + UserInfoTable.USER_ID + INNER_JOIN + SessionsTable.TABLE_NAME + " s on s." + SessionsTable.USER_ID + "=u." + UserInfoTable.USER_ID +
AND + "s." + SessionsTable.SERVER_ID + "=u." + UserInfoTable.SERVER_ID + AND + "s." + SessionsTable.SERVER_ID + "=u." + UserInfoTable.SERVER_ID +
INNER_JOIN + JoinAddressTable.TABLE_NAME + " j on j." + JoinAddressTable.JOIN_ADDRESS + "=u." + UserInfoTable.JOIN_ADDRESS + GROUP_BY + "u." + UserInfoTable.USER_ID + ',' + "u." + UserInfoTable.SERVER_ID + ',' + "u." + UserInfoTable.JOIN_ADDRESS;
GROUP_BY + "u." + UserInfoTable.USER_ID + ",u." + UserInfoTable.SERVER_ID;
String sql = SELECT +
"session_id," +
"j." + JoinAddressTable.ID + " as join_address_id" +
FROM + '(' + selectLatestSessionIds + ") q1 " +
INNER_JOIN + JoinAddressTable.TABLE_NAME + " j on " +
"j." + JoinAddressTable.JOIN_ADDRESS + "=q1." + UserInfoTable.JOIN_ADDRESS;
Map<Integer, Integer> joinAddressIdsBySessionId = query(new QueryAllStatement<>(sql) { Map<Integer, Integer> joinAddressIdsBySessionId = query(new QueryAllStatement<>(sql) {
@Override @Override