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

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

XMLWordPrintable

    • MySQL
    • MOODLE_32_STABLE, MOODLE_33_STABLE, MOODLE_34_STABLE
    • MOODLE_32_STABLE, MOODLE_33_STABLE
    • m34_MDL-59100_MySQL8_INFORMATION_SCHEMAs_Need_Lowercasing
    • 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.

      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);
                   }
      
      

            matteo Matteo Scaramuccia
            poltawski Dan Poltawski
            Adrian Greeve Adrian Greeve
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.