Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-59100

get_columns() query doesn't work with mysql 8.0 - needs lowercasing

    XMLWordPrintable

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      No way to test it w/ MySQL 8 but peer reviewing it: MDL-59099 is required too. Instead, regressions should be tested here.

      At least run both DDL and DML tests:

      • vendor/bin/phpunit core_ddl_testcase lib/ddl/tests/ddl_test.php
      • vendor/bin/phpunit core_dml_testcase lib/dml/tests/dml_test.php

      against the supported version of MariaDB and MySQL.

      Show
      No way to test it w/ MySQL 8 but peer reviewing it: MDL-59099 is required too. Instead, regressions should be tested here. At least run both DDL and DML tests: vendor/bin/phpunit core_ddl_testcase lib/ddl/tests/ddl_test.php vendor/bin/phpunit core_dml_testcase lib/dml/tests/dml_test.php against the supported version of MariaDB and MySQL.
    • Affected Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_32_STABLE, MOODLE_33_STABLE
    • Epic Link:
    • Pull from Repository:
    • Pull Master Branch:
      m34_MDL-59100_MySQL8_INFORMATION_SCHEMAs_Need_Lowercasing

      Description

      This patch fixes it, similar to patches elsewhere..

      diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php
      index 4227826b9d..a6956fd062 100644
      --- a/lib/dml/mysqli_native_moodle_database.php
      +++ b/lib/dml/mysqli_native_moodle_database.php
      @@ -691,6 +691,7 @@ class mysqli_native_moodle_database extends moodle_database {
               if ($result->num_rows > 0) {
                   // standard table exists
                   while ($rawcolumn = $result->fetch_assoc()) {
      +                $rawcolumn = array_change_key_case($rawcolumn, CASE_LOWER);
                       $info = (object)$this->get_column_info((object)$rawcolumn);
                       $structure[$info->name] = new database_column_info($info);
                   }
      
      

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17