diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 89a18d00eea..4227826b9d6 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -519,6 +519,9 @@ class mysqli_native_moodle_database extends moodle_database { throw new dml_connection_exception($dberr); } + // Disable logging until we are fully setup. + $this->query_log_prevent(); + if (isset($dboptions['dbcollation'])) { $collationinfo = explode('_', $dboptions['dbcollation']); $this->dboptions['dbcollation'] = $dboptions['dbcollation']; @@ -527,9 +530,6 @@ class mysqli_native_moodle_database extends moodle_database { } $charset = reset($collationinfo); - // Disable logging until we are fully setup. - $this->query_log_prevent(); - $this->query_start("--set_charset()", null, SQL_QUERY_AUX); $this->mysqli->set_charset($charset); $this->query_end(true);