mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 15:40:45 +01:00
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
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user