Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2019-10-01 03:57:19 +0300
committerdiosmosis <diosmosis@users.noreply.github.com>2019-10-01 03:57:19 +0300
commit416697204ae953c4da6c2bfd9c70562021b4b1c8 (patch)
treeca3a342806535d8c7550cfe86226b50a3c1f4ffd
parent546d429972b7f1b9b4ca869ffc32d44b13935d39 (diff)
Catch error if tx_isolation is not available (#14924)
-rw-r--r--core/Db/TransactionLevel.php11
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;