Fix issue with loading flags on non-existing regions from SQL.

No idea if this actually works or what the issue was ¯\_(ツ)_/¯
Thanks to EONABloodrayne for the updated statement (if it works)
and also blame them if it doesn't.
Fixes WORLDGUARD-3355.
This commit is contained in:
wizjany 2016-05-20 17:02:37 -04:00
parent 43a5bf1638
commit 4239bdc96d

View File

@ -223,7 +223,11 @@ private void loadFlags() throws SQLException {
PreparedStatement stmt = closer.register(conn.prepareStatement( PreparedStatement stmt = closer.register(conn.prepareStatement(
"SELECT region_id, flag, value " + "SELECT region_id, flag, value " +
"FROM " + config.getTablePrefix() + "region_flag " + "FROM " + config.getTablePrefix() + "region_flag " +
"WHERE world_id = " + worldId)); "WHERE world_id = " + worldId +
"AND region_id IN " +
"(SELECT id FROM " +
config.getTablePrefix() + "region WHERE" +
"world_id=" + worldId + ")"));
ResultSet rs = closer.register(stmt.executeQuery()); ResultSet rs = closer.register(stmt.executeQuery());