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

Explicitly set MYSQLI_REPORT_OFF in the mysql native driver

XMLWordPrintable

    • MOODLE_401_STABLE
    • MOODLE_401_STABLE
    • Hide

      Requirements

      1. This must be tested both with mysql and mariadb.
      2. This requires the tester to have php 7.4, 8.0 and 8.1 with all the 4.1 requirements.

      Steps

      With php 7.4 and php 8.0 (both with mysql and mariadb).

      1. Run php admin/tool/phpunit/cli/init.php
      2. Verify that the process ends ok (composer installed, then the tables... with the "PHPUnit test environment setup complete" message shown at the end.
      3. Repeat the previous 2 steps for all the combinations (4 combinations).

      With php 8.1 (both with mysql and mariadb).

      1. Run php admin/tool/phpunit/cli/init.php
      2. Note that there will be hundreds of PHP Warnings, ignore them completely. They will be fixed elsewhere.
      3. Verify that the process ends ok (composer installed, then the tables... with the "PHPUnit test environment setup complete" message shown at the end.
      4. Repeat the previous 3 steps for all the combinations (2 combinations).
      Show
      Requirements This must be tested both with mysql and mariadb. This requires the tester to have php 7.4, 8.0 and 8.1 with all the 4.1 requirements. Steps With php 7.4 and php 8.0 (both with mysql and mariadb). Run php admin/tool/phpunit/cli/init.php Verify that the process ends ok (composer installed, then the tables... with the "PHPUnit test environment setup complete" message shown at the end. Repeat the previous 2 steps for all the combinations (4 combinations). With php 8.1 (both with mysql and mariadb). Run php admin/tool/phpunit/cli/init.php Note that there will be hundreds of PHP Warnings, ignore them completely. They will be fixed elsewhere. Verify that the process ends ok (composer installed, then the tables... with the "PHPUnit test environment setup complete" message shown at the end. Repeat the previous 3 steps for all the combinations (2 combinations).

      Before PHP 8.1, the mysqli extension had MYSQLI_REPORT_OFF as default setting.

      With PHP 8.1, it has been changed to MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT

      The default error handling mode has been changed from "silent" to
      "exceptions". See https://www.php.net/manual/en/mysqli-driver.report-mode.php
      for details of behavior changes and how to explicitly set this attribute. To
      keep the old behavior, use mysqli_report(MYSQLI_REPORT_OFF);
      RFC: https://wiki.php.net/rfc/mysqli_default_errmode

      That implies that now, instead of just returning null or false, some methods are effectively throwing exceptions instead.

      Problem is that our mysqli native driver is not ready to handle those exceptions, hence the plan is:

      • In this issue, part of the PHP 8.1 epic, set the extension back to MYSQLI_REPORT_OFF.
      • In another issue, apart from the PHP 8.1 epic (MDL-75761), analyse the possibility of modernising our mysql native driver to get advantage of exceptions handling and so on.

      Of course, we'll need to verify both mysql and children drivers (mariadb, auroramysql).

      Ciao

            stronk7 Eloy Lafuente (stronk7)
            stronk7 Eloy Lafuente (stronk7)
            Jake Dallimore Jake Dallimore
            Andrew Lyons Andrew Lyons
            Andrew Lyons Andrew Lyons
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 6 hours, 50 minutes
                6h 50m

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