diff --git a/lib/dml/mssql_native_moodle_database.php b/lib/dml/mssql_native_moodle_database.php index fd1721abfb0..fd6d22856de 100644 --- a/lib/dml/mssql_native_moodle_database.php +++ b/lib/dml/mssql_native_moodle_database.php @@ -183,6 +183,9 @@ class mssql_native_moodle_database extends moodle_database { throw new dml_connection_exception($dberr); } + // Disable logging until we are fully setup. + $this->query_log_prevent(); + // already connected, select database and set some env. variables $this->query_start("--mssql_select_db", null, SQL_QUERY_AUX); $result = mssql_select_db($this->dbname, $this->mssql); @@ -238,6 +241,9 @@ class mssql_native_moodle_database extends moodle_database { // Fetch/offset is supported staring from SQL Server 2012. $this->supportsoffsetfetch = $serverinfo['version'] > '11'; + // We can enable logging now. + $this->query_log_allow(); + // Connection stabilised and configured, going to instantiate the temptables controller $this->temptables = new mssql_native_moodle_temptables($this); diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 663bd6a6d88..40c25c465af 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -449,6 +449,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(); + $this->query_start("--set_charset()", null, SQL_QUERY_AUX); $this->mysqli->set_charset('utf8'); $this->query_end(true); @@ -466,6 +469,9 @@ class mysqli_native_moodle_database extends moodle_database { $this->query_end($result); } + // We can enable logging now. + $this->query_log_allow(); + // Connection stabilised and configured, going to instantiate the temptables controller $this->temptables = new mysqli_native_moodle_temptables($this); diff --git a/lib/dml/oci_native_moodle_database.php b/lib/dml/oci_native_moodle_database.php index 343663fc5b6..6f9161087f3 100644 --- a/lib/dml/oci_native_moodle_database.php +++ b/lib/dml/oci_native_moodle_database.php @@ -189,6 +189,9 @@ class oci_native_moodle_database extends moodle_database { throw new dml_connection_exception($dberr); } + // Disable logging until we are fully setup. + $this->query_log_prevent(); + // Make sure moodle package is installed - now required. if (!$this->oci_package_installed()) { try { @@ -216,6 +219,9 @@ class oci_native_moodle_database extends moodle_database { //note: do not send "ALTER SESSION SET NLS_NUMERIC_CHARACTERS='.,'" ! // instead fix our PHP code to convert "," to "." properly! + // We can enable logging now. + $this->query_log_allow(); + // Connection stabilised and configured, going to instantiate the temptables controller $this->temptables = new oci_native_moodle_temptables($this, $this->unique_session_id); diff --git a/lib/dml/pgsql_native_moodle_database.php b/lib/dml/pgsql_native_moodle_database.php index efc5043eac6..5813133c038 100644 --- a/lib/dml/pgsql_native_moodle_database.php +++ b/lib/dml/pgsql_native_moodle_database.php @@ -170,6 +170,9 @@ class pgsql_native_moodle_database extends moodle_database { throw new dml_connection_exception($dberr); } + // Disable logging until we are fully setup. + $this->query_log_prevent(); + $this->query_start("--pg_set_client_encoding()", null, SQL_QUERY_AUX); pg_set_client_encoding($this->pgsql, 'utf8'); $this->query_end(true); @@ -198,6 +201,9 @@ class pgsql_native_moodle_database extends moodle_database { throw new dml_connection_exception('Can not read bytea type.'); } + // We can enable logging now. + $this->query_log_allow(); + // Connection stabilised and configured, going to instantiate the temptables controller $this->temptables = new pgsql_native_moodle_temptables($this); diff --git a/lib/dml/sqlsrv_native_moodle_database.php b/lib/dml/sqlsrv_native_moodle_database.php index e2d253f1669..c9a71a2e9c5 100644 --- a/lib/dml/sqlsrv_native_moodle_database.php +++ b/lib/dml/sqlsrv_native_moodle_database.php @@ -204,6 +204,9 @@ class sqlsrv_native_moodle_database extends moodle_database { throw new dml_connection_exception($dberr); } + // Disable logging until we are fully setup. + $this->query_log_prevent(); + // Allow quoted identifiers $sql = "SET QUOTED_IDENTIFIER ON"; $this->query_start($sql, null, SQL_QUERY_AUX); @@ -250,6 +253,9 @@ class sqlsrv_native_moodle_database extends moodle_database { // Fetch/offset is supported staring from SQL Server 2012. $this->supportsoffsetfetch = $serverinfo['version'] > '11'; + // We can enable logging now. + $this->query_log_allow(); + // Connection established and configured, going to instantiate the temptables controller $this->temptables = new sqlsrv_native_moodle_temptables($this);