From 22e22a39afea8adfbec76e9586bb9a5bba4c9746 Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Thu, 27 Apr 2017 09:39:36 +0800 Subject: [PATCH] MDL-58689 dml: prevent logging during setup --- lib/dml/mysqli_native_moodle_database.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);