fixes (some test cases don't pass)

This commit is contained in:
boy0001 2014-11-09 12:45:45 +11:00
parent e7f9030757
commit 2211a8fb24
3 changed files with 263 additions and 17 deletions

View file

@ -600,7 +600,10 @@ public class PlotMain extends JavaPlugin {
// Use mysql?
if (Settings.DB.USE_MYSQL) {
DBFunc.dbManager = new SQLManager();
if (DBFunc.dbManager == null) {
DBFunc.dbManager = new SQLManager();
}
try {
mySQL = new MySQL(this, Settings.DB.HOST_NAME, Settings.DB.PORT, Settings.DB.DATABASE, Settings.DB.USER, Settings.DB.PASSWORD);
connection = mySQL.openConnection();
@ -620,6 +623,12 @@ public class PlotMain extends JavaPlugin {
if (!res.next()) {
DBFunc.createTables("mysql", false);
}
else {
res = meta.getTables(null, null, Settings.DB.PREFIX + "plot_comments", null);
if (!res.next()) {
DBFunc.createTables("mysql", false);
}
}
}
}
}