Skip to content

Commit

Permalink
Restore check for zero or negative transaction nesting
Browse files Browse the repository at this point in the history
  • Loading branch information
robbieaverill authored and maxime-rainville committed Jun 20, 2018
1 parent d8430f5 commit df25768
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/ORM/Connect/MySQLDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ public function transactionEnd($chain = false)
return false;
}
--$this->transactionNesting;
$this->query('COMMIT AND ' . ($chain ? '' : 'NO ') . 'CHAIN');
if ($this->transactionNesting <= 0) {
$this->transactionNesting = 0;
$this->query('COMMIT AND ' . ($chain ? '' : 'NO ') . 'CHAIN');
}
return true;
}

Expand Down

0 comments on commit df25768

Please sign in to comment.