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:
-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;