Skip to content

Commit 50c7428

Browse files
committed
- Added Exception when attempting to execute a dry-run in a already opened transaction, since it's not possible to nest transactions.
1 parent d2af77b commit 50c7428

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Databases/MySQL.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,9 @@ public function transactionRollback() {
265265
public function dryRun($callback = null) {
266266
$result = null;
267267
$exception = null;
268+
if($this->pdo->inTransaction()) {
269+
throw new \Exception('Connection is already in a transaction. Dry-run not possible.');
270+
}
268271
$this->transactionStart();
269272
try {
270273
$result = call_user_func($callback, $this);

0 commit comments

Comments
 (0)