From ad75e8bb15cbc485d67c8d34950a4840d5e172a6 Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Mon, 4 Sep 2017 09:57:20 +0200 Subject: [PATCH] MDL-59596 ddl: Added has_breaking_change_sqlmode() --- lib/dml/mariadb_native_moodle_database.php | 6 ++++++ lib/dml/mysqli_native_moodle_database.php | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/lib/dml/mariadb_native_moodle_database.php b/lib/dml/mariadb_native_moodle_database.php index 48debee57ce..3a493a754e2 100644 --- a/lib/dml/mariadb_native_moodle_database.php +++ b/lib/dml/mariadb_native_moodle_database.php @@ -94,6 +94,12 @@ class mariadb_native_moodle_database extends mysqli_native_moodle_database { return version_compare($version, '10.2.7', '>='); } + public function has_breaking_change_sqlmode() { + $version = $this->get_server_info()['version']; + // Breaking change since 10.2.4: https://mariadb.com/kb/en/the-mariadb-library/sql-mode/#setting-sql_mode. + return version_compare($version, '10.2.4', '>='); + } + /** * It is time to require transactions everywhere. * diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 05c6c433ae0..be649ec928c 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -817,6 +817,14 @@ class mysqli_native_moodle_database extends moodle_database { return false; } + /** + * Indicates whether SQL_MODE default value has changed in a not backward compatible way. + * @return boolean True when SQL_MODE breaks BC; otherwise, false. + */ + public function has_breaking_change_sqlmode() { + return false; + } + /** * Returns moodle column info for raw column from information schema. * @param stdClass $rawcolumn