MDL-19711 dml: call mysqli::real_connect() with @
authorSrdjan <srdjan@catalyst.net.nz>
Tue, 19 May 2020 08:09:14 +0000 (18:09 +1000)
committerSrdjan <srdjan@catalyst.net.nz>
Tue, 19 May 2020 08:09:14 +0000 (18:09 +1000)
lib/dml/mysqli_native_moodle_database.php

index 50b76ef..4bfa04c 100644 (file)
@@ -569,7 +569,8 @@ 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";
         }