From 6924954471cbb0eaeb10db87f89968d2a40b998d Mon Sep 17 00:00:00 2001 From: Neill Magill Date: Wed, 6 Sep 2017 15:04:39 +0100 Subject: [PATCH] MDL-60041 dml: MOODLELIB sql file must have Unix line endings If the file does not have Unix line endings then the regular expression in oci_native_moodle_database::attempt_oci_package_install() does not split it correctly. This leads to an invalid package being created in Oracle. The .gitattribute file changes for oci_native_moodle_package.sql force it to have Unix style line endings when the branch is checked out and the file does not already exist. The file has been modified so that the Unix style line endings are applied even if the file already exists, for example when pulling in this change to an existing branch. --- .gitattributes | 1 + lib/dml/oci_native_moodle_package.sql | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.gitattributes b/.gitattributes index fb39fe041bc..8afacce4e59 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,5 @@ **/yui/build/** -diff **/amd/build/** -diff +lib/dml/oci_native_moodle_package.sql text eol=lf theme/bootstrapbase/style/editor.css -diff theme/bootstrapbase/style/moodle.css -diff diff --git a/lib/dml/oci_native_moodle_package.sql b/lib/dml/oci_native_moodle_package.sql index 850fb5fff5a..1d6dec943bb 100644 --- a/lib/dml/oci_native_moodle_package.sql +++ b/lib/dml/oci_native_moodle_package.sql @@ -30,6 +30,8 @@ * - bit ops: To provide cross-db bitwise operations to be used by the * sql_bitXXX() helper functions * - one space hacks: One space empty string substitute hacks. + * + * Moodle will not parse this file correctly if it uses Windows line endings. */ CREATE OR REPLACE PACKAGE MOODLELIB AS