Commit ffa3dd74 authored by Aaron Wells's avatar Aaron Wells Committed by Gerrit Code Review

Merge "Disable transactions in MySQL (Bug 1514608)"

parents deb66180 e52be8a3
......@@ -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