mirror of
https://github.com/mangosfour/server.git
synced 2025-12-14 16:37:01 +00:00
[11061] Bring 'autocommit' mode for MySQL back. This MySQL feature operates in so frustrating way so it is better to keep it ALWAYS ENABLED!!!
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
f7a45e9e9a
commit
fce48282ad
3 changed files with 7 additions and 10 deletions
|
|
@ -283,10 +283,7 @@ bool Database::Execute(const char *sql)
|
||||||
return DirectExecute(sql);
|
return DirectExecute(sql);
|
||||||
|
|
||||||
// Simple sql statement
|
// Simple sql statement
|
||||||
pTrans = new SqlTransaction;
|
m_threadBody->Delay(new SqlStatement(sql));
|
||||||
pTrans->DelayExecute(sql);
|
|
||||||
|
|
||||||
m_threadBody->Delay(pTrans);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -152,12 +152,12 @@ bool MySQLConnection::Initialize(const char *infoString)
|
||||||
// autocommit is turned of during it.
|
// autocommit is turned of during it.
|
||||||
// Setting it to on makes atomic updates work
|
// Setting it to on makes atomic updates work
|
||||||
// ---
|
// ---
|
||||||
// if you want atomic updates to work - USE TRANSACTIONS!!!
|
// LEAVE 'AUTOCOMMIT' MODE ALWAYS ENABLED!!!
|
||||||
// no need to mess up with autocommit mode which might degrade server performance!
|
// W/O IT EVEN 'SELECT' QUERIES WOULD REQUIRE TO BE WRAPPED INTO 'START TRANSACTION'<>'COMMIT' CLAUSES!!!
|
||||||
if (!mysql_autocommit(mMysql, 0))
|
if (!mysql_autocommit(mMysql, 1))
|
||||||
DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 0");
|
DETAIL_LOG("AUTOCOMMIT SUCCESSFULLY SET TO 1");
|
||||||
else
|
else
|
||||||
DETAIL_LOG("AUTOCOMMIT NOT SET TO 0");
|
DETAIL_LOG("AUTOCOMMIT NOT SET TO 1");
|
||||||
/*-------------------------------------*/
|
/*-------------------------------------*/
|
||||||
|
|
||||||
// set connection properties to UTF8 to properly handle locales for different
|
// set connection properties to UTF8 to properly handle locales for different
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#ifndef __REVISION_NR_H__
|
#ifndef __REVISION_NR_H__
|
||||||
#define __REVISION_NR_H__
|
#define __REVISION_NR_H__
|
||||||
#define REVISION_NR "11060"
|
#define REVISION_NR "11061"
|
||||||
#endif // __REVISION_NR_H__
|
#endif // __REVISION_NR_H__
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue