Commit 6ded76cc authored by Aaron Wells's avatar Aaron Wells
Browse files

Disable transactions in MySQL (Bug 1514608)

Mahara's usage of transactions has been causing
major deadlock issues in MySQL with InnoDB.
The immediate fix is to disable them.

behatnotneeded: Covered by existing tests

Change-Id: I2c7e6424e2d58502acd26fdd5d05c797e4ee5eac
(cherry picked from commit e52be8a3)
parent a57aee9f
......@@ -1522,6 +1522,9 @@ $GLOBALS['_TRANSACTION_LEVEL'] = 0;
*/
function db_begin() {
global $db;
if (is_mysql()) {
return;
}
$GLOBALS['_TRANSACTION_LEVEL']++;
$db->StartTrans();
......@@ -1535,6 +1538,9 @@ function db_begin() {
*/
function db_commit() {
global $db;
if (is_mysql()) {
return;
}
$GLOBALS['_TRANSACTION_LEVEL']--;
if ($GLOBALS['_TRANSACTION_LEVEL'] == 0) {
......@@ -1553,6 +1559,9 @@ function db_commit() {
*/
function db_rollback() {
global $db;
if (is_mysql()) {
return;
}
$db->FailTrans();
for ($i = $GLOBALS['_TRANSACTION_LEVEL']; $i >= 0; $i--) {
$db->CompleteTrans();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment