forked from LogBlock/LogBlock
Check sign text is being logged before attempting to update table
This commit is contained in:
@@ -217,12 +217,14 @@ class Updater
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (final WorldConfig wcfg : getLoggedWorlds()) {
|
for (final WorldConfig wcfg : getLoggedWorlds()) {
|
||||||
final ResultSet rs = st.executeQuery("SHOW FULL COLUMNS FROM `"+wcfg.table+"-sign` WHERE field = 'signtext'");
|
if (wcfg.isLogging(Logging.SIGNTEXT)) {
|
||||||
if (rs.next() && !rs.getString("Collation").substring(0,4).equalsIgnoreCase("utf8")) {
|
final ResultSet rs = st.executeQuery("SHOW FULL COLUMNS FROM `"+wcfg.table+"-sign` WHERE field = 'signtext'");
|
||||||
st.execute("ALTER TABLE `"+wcfg.table+"-sign` CONVERT TO CHARSET utf8");
|
if (rs.next() && !rs.getString("Collation").substring(0,4).equalsIgnoreCase("utf8")) {
|
||||||
getLogger().info("Table "+wcfg.table+"-sign modified");
|
st.execute("ALTER TABLE `"+wcfg.table+"-sign` CONVERT TO CHARSET utf8");
|
||||||
} else {
|
getLogger().info("Table "+wcfg.table+"-sign modified");
|
||||||
getLogger().info("Table "+wcfg.table+"-sign already fine, skipping it");
|
} else {
|
||||||
|
getLogger().info("Table "+wcfg.table+"-sign already fine, skipping it");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
st.close();
|
st.close();
|
||||||
|
Reference in New Issue
Block a user