From 973aa94cb5837a8c3f560e84ef4c53b070c032a5 Mon Sep 17 00:00:00 2001 From: akkadius Date: Tue, 23 Sep 2014 18:28:17 -0500 Subject: [PATCH] Fix for database schema conversion where `character_` table has 0 characters present. This will allow the tables to still be created properly and the old one renamed. --- common/database.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 6683e8ebd..cc8236586 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -924,9 +924,9 @@ bool Database::CheckDatabaseConversions() { int runconvert = 0; /* Check For Legacy Storage Method */ - std::string rquery = StringFormat("SELECT `profile` FROM `character_` LIMIT 1"); + std::string rquery = StringFormat("SHOW TABLES LIKE 'character_'"); auto results = QueryDatabase(rquery); - for (auto row = results.begin(); row != results.end(); ++row) { + if (results.RowCount() == 1){ runconvert = 1; printf("\n\n::: Legacy Character Data Binary Blob Storage Detected... \n"); printf("----------------------------------------------------------\n\n");