Core: ported headers cleanup from master branch

This commit is contained in:
ariel-
2017-06-19 23:20:06 -03:00
parent 052fc24315
commit 85a7d5ce9a
1207 changed files with 21154 additions and 18404 deletions

View File

@@ -15,14 +15,15 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "DatabaseEnv.h"
#include "Transaction.h"
#include "MySQLConnection.h"
#include "PreparedStatement.h"
#include <mysqld_error.h>
std::mutex TransactionTask::_deadlockLock;
//- Append a raw ad-hoc query to the transaction
void Transaction::Append(const char* sql)
void Transaction::Append(char const* sql)
{
SQLElementData data;
data.type = SQL_ELEMENT_RAW;
@@ -45,9 +46,8 @@ void Transaction::Cleanup()
if (_cleanedUp)
return;
while (!m_queries.empty())
for (SQLElementData const& data : m_queries)
{
SQLElementData const &data = m_queries.front();
switch (data.type)
{
case SQL_ELEMENT_PREPARED:
@@ -57,10 +57,9 @@ void Transaction::Cleanup()
free((void*)(data.element.query));
break;
}
m_queries.pop_front();
}
m_queries.clear();
_cleanedUp = true;
}