mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 08:55:32 +01:00
Core/DBLayer: Add an assert to trace down when a prepared statement creation has failed (99% it will be because of a bad query) - to prevent crashes at a later stage
--HG-- branch : trunk
This commit is contained in:
@@ -323,15 +323,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));
|
||||
return;
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
if (mysql_stmt_prepare(stmt, sql, static_cast<unsigned long>(strlen(sql))))
|
||||
{
|
||||
mysql_stmt_close(stmt);
|
||||
sLog.outSQLDriver("[ERROR]: In mysql_stmt_close() id: %u, sql: \"%s\"", index, sql);
|
||||
sLog.outSQLDriver("[ERROR]: In mysql_stmt_prepare() id: %u, sql: \"%s\"", index, sql);
|
||||
sLog.outSQLDriver("[ERROR]: %s", mysql_error(m_Mysql));
|
||||
return;
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
MySQLPreparedStatement* mStmt = new MySQLPreparedStatement(stmt);
|
||||
|
||||
Reference in New Issue
Block a user