Skip to content

Commit

Permalink
Stricter SQL checks (#2829)
Browse files Browse the repository at this point in the history
* Add assert(false) on unexpected mysql error

* Only allow one transaction at the same time
  • Loading branch information
0blu authored Nov 15, 2024
1 parent 1d6447b commit 36943cd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/shared/Database/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,7 @@ bool Database::CommitTransaction()
return false;

//check if we have pending transaction
//ASSERT(m_TransStorage->get());
if (!m_TransStorage->get())
return false;
ASSERT(m_TransStorage->get()); // if we will get a nested transaction request - we MUST fix code!!!

//if async execution is not available
if(!m_bAllowAsyncTransactions)
Expand Down
1 change: 1 addition & 0 deletions src/shared/Database/DatabaseMysql.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ bool MySQLConnection::HandleMySQLError(uint32 errNo)
return false;
default:
sLog.Out(LOG_DBERROR, LOG_LVL_MINIMAL, "Unhandled MySQL errno %u. Unexpected behaviour possible.", errNo);
ASSERT(false);
return false;
}
}
Expand Down

0 comments on commit 36943cd

Please sign in to comment.