mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 07:06:45 +01:00
Fix rank for new versions of MySQL
This commit is contained in:
parent
550a3df616
commit
ea70c937f2
@ -393,7 +393,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
for (PrimarySkillType primarySkillType : PrimarySkillType.NON_CHILD_SKILLS) {
|
||||||
String skillName = primarySkillType.name().toLowerCase(Locale.ENGLISH);
|
String skillName = primarySkillType.name().toLowerCase(Locale.ENGLISH);
|
||||||
// Get count of all users with higher skill level than player
|
// Get count of all users with higher skill level than player
|
||||||
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillName + " > 0 " +
|
String sql = "SELECT COUNT(*) AS 'rank' FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id WHERE " + skillName + " > 0 " +
|
||||||
"AND " + skillName + " > (SELECT " + skillName + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
|
"AND " + skillName + " > (SELECT " + skillName + " FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
|
||||||
"WHERE user = ?)";
|
"WHERE user = ?)";
|
||||||
|
|
||||||
@ -427,7 +427,7 @@ public final class SQLDatabaseManager implements DatabaseManager {
|
|||||||
statement.close();
|
statement.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
String sql = "SELECT COUNT(*) AS rank FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
|
String sql = "SELECT COUNT(*) AS 'rank' FROM " + tablePrefix + "users JOIN " + tablePrefix + "skills ON user_id = id " +
|
||||||
"WHERE " + ALL_QUERY_VERSION + " > 0 " +
|
"WHERE " + ALL_QUERY_VERSION + " > 0 " +
|
||||||
"AND " + ALL_QUERY_VERSION + " > " +
|
"AND " + ALL_QUERY_VERSION + " > " +
|
||||||
"(SELECT " + ALL_QUERY_VERSION + " " +
|
"(SELECT " + ALL_QUERY_VERSION + " " +
|
||||||
|
Loading…
Reference in New Issue
Block a user