aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-09-20 20:53:32 +0200
committerMachiavelli <none@none>2010-09-20 20:53:32 +0200
commitce2d4e9a20608f69c29a31d4bdf28bb0142b3fbb (patch)
tree72a2b09dc479cb36d80202d16e956fd59b9642fc
parenta5099763691f2d4d80de7db557f22b024b717cbd (diff)
Core/DBLayer: Correctly print relevant mysql prepared statement creation error to give the end-user an idea of what exactly went wrong (missing SQL updates are the culprit of creation failure 99% of the time)
--HG-- branch : trunk
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index ef78d0afdb0..54bf97ce601 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -319,15 +319,15 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql)
{
sLog.outSQLDriver("[ERROR]: In mysql_stmt_init() id: %u, sql: \"%s\"", index, sql);
sLog.outSQLDriver("[ERROR]: %s", mysql_error(m_Mysql));
- ASSERT(false);
+ exit(1);
}
if (mysql_stmt_prepare(stmt, sql, static_cast<unsigned long>(strlen(sql))))
{
- mysql_stmt_close(stmt);
sLog.outSQLDriver("[ERROR]: In mysql_stmt_prepare() id: %u, sql: \"%s\"", index, sql);
- sLog.outSQLDriver("[ERROR]: %s", mysql_error(m_Mysql));
- ASSERT(false);
+ sLog.outSQLDriver("[ERROR]: %s", mysql_stmt_error(stmt));
+ mysql_stmt_close(stmt);
+ exit(1);
}
MySQLPreparedStatement* mStmt = new MySQLPreparedStatement(stmt);