Skip to content

Commit

Permalink
Fix typo in extension tab icon query
Browse files Browse the repository at this point in the history
Affects issues:
- Fixed #2608
  • Loading branch information
AuroraLS3 committed Sep 25, 2022
1 parent 011ce77 commit ccc6861
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public Map<Integer, ExtensionData.Builder> executeQuery(SQLDB db) {
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public Map<Integer, ExtensionData.Builder> executeQuery(SQLDB db) {
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ public Map<Integer, ExtensionData.Builder> executeQuery(SQLDB db) {
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" +
ORDER_BY + "table_id ASC, group_name ASC";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public Map<Integer, ExtensionData.Builder> executeQuery(SQLDB db) {
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" +
AND + "p1." + ExtensionProviderTable.FORMAT_TYPE + "!=?" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public Map<Integer, ExtensionData.Builder> executeQuery(SQLDB db) {
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ private Query<Map<Integer, ExtensionData.Builder>> fetchIncompletePlayerDataByPl
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private Query<Map<Integer, ExtensionData.Builder>> fetchGroupsByPluginID() {
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?" +
ORDER_BY + ExtensionGroupsTable.GROUP_NAME + " ASC";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private Query<Map<Integer, ExtensionData.Builder>> fetchIncompleteServerDataByPl
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 + 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 + "=?" +
AND + "p1." + ExtensionProviderTable.HIDDEN + "=?";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,22 @@ public void prepare(PreparedStatement statement) throws SQLException {
}

private void populateLatestSessions() {
String sql = SELECT +
String selectLatestSessionIds = SELECT +
"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" +
INNER_JOIN + SessionsTable.TABLE_NAME + " s on s." + SessionsTable.USER_ID + "=u." + UserInfoTable.USER_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;
GROUP_BY + "u." + UserInfoTable.USER_ID + ',' + "u." + UserInfoTable.SERVER_ID + ',' + "u." + UserInfoTable.JOIN_ADDRESS;

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) {
@Override
Expand Down

0 comments on commit ccc6861

Please sign in to comment.