Core/DBLayer: Prevent using prepared statements on wrong database

This commit is contained in:
Shauren authored and Ovahlord committed 2020-04-15 19:18:58 +02:00
1 parent eaee7b3cfa
commit d003ebd8e4
98 files changed
+569 -541

No files matched your search

@@ -192,7 +192,7 @@ bool MySQLConnection::Execute(char const* sql)
return true;
}
bool MySQLConnection::Execute(PreparedStatement* stmt)
bool MySQLConnection::Execute(PreparedStatementBase* stmt)
{
if (!m_Mysql)
return false;
@@ -240,7 +240,7 @@ bool MySQLConnection::Execute(PreparedStatement* stmt)
return true;
}
bool MySQLConnection::_Query(PreparedStatement* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount)
bool MySQLConnection::_Query(PreparedStatementBase* stmt, MySQLResult** pResult, uint64* pRowCount, uint32* pFieldCount)
{
if (!m_Mysql)
return false;
@@ -381,7 +381,7 @@ int MySQLConnection::ExecuteTransaction(SQLTransaction& transaction)
{
case SQL_ELEMENT_PREPARED:
{
PreparedStatement* stmt = data.element.stmt;
PreparedStatementBase* stmt = data.element.stmt;
ASSERT(stmt);
if (!Execute(stmt))
{
@@ -490,7 +490,7 @@ void MySQLConnection::PrepareStatement(uint32 index, std::string const& sql, Con
}
}
PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
PreparedResultSet* MySQLConnection::Query(PreparedStatementBase* stmt)
{
MySQLResult* result = nullptr;
uint64 rowCount = 0;