Merge branch 'srdjan-slave-conn' of https://github.com/srdjan-catalyst/moodle
authorAndrew Nicols <andrew@nicols.co.uk>
Tue, 19 May 2020 08:13:48 +0000 (16:13 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Tue, 19 May 2020 08:13:48 +0000 (16:13 +0800)
lib/dml/mysqli_native_moodle_database.php

index 80dc020..4bfa04c 100644 (file)
@@ -567,8 +567,10 @@ class mysqli_native_moodle_database extends moodle_database {
         }
 
         $conn = null;
+        $dberr = null;
         try {
-            $conn = $this->mysqli->real_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbsocket);
+            // real_connect() is doing things we don't expext.
+            $conn = @$this->mysqli->real_connect($dbhost, $dbuser, $dbpass, $dbname, $dbport, $dbsocket);
         } catch (\Exception $e) {
             $dberr = "$e";
         }