diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-10-01 03:57:19 +0300 |
---|---|---|
committer | diosmosis <diosmosis@users.noreply.github.com> | 2019-10-01 03:57:19 +0300 |
commit | 416697204ae953c4da6c2bfd9c70562021b4b1c8 (patch) | |
tree | ca3a342806535d8c7550cfe86226b50a3c1f4ffd /core | |
parent | 546d429972b7f1b9b4ca869ffc32d44b13935d39 (diff) |
Catch error if tx_isolation is not available (#14924)
Diffstat (limited to 'core')
-rw-r--r-- | core/Db/TransactionLevel.php | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/core/Db/TransactionLevel.php b/core/Db/TransactionLevel.php index 1a58df9ca6..c19699084c 100644 --- a/core/Db/TransactionLevel.php +++ b/core/Db/TransactionLevel.php @@ -40,7 +40,16 @@ class TransactionLevel public function setUncommitted() { - $backup = $this->db->fetchOne('SELECT @@TX_ISOLATION'); + try { + $backup = $this->db->fetchOne('SELECT @@TX_ISOLATION'); + } catch (\Exception $e) { + try { + $backup = $this->db->fetchOne('SELECT @@transaction_isolation'); + } catch (\Exception $e) { + return false; + } + } + try { $this->db->query('SET SESSION TRANSACTION ISOLATION LEVEL READ UNCOMMITTED'); $this->statusBackup = $backup; |