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

Incorrect CASE statement breaking under mssql, sqlsrv and oracle drivers

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 3.0
    • 3.0
    • Forum, Unit tests
    • MOODLE_30_STABLE
    • MOODLE_30_STABLE
    • Hide

      1) Repeat testing instructions from MDL-50993 against all DBs.
      2) Run unit tests against all DBs, vendor/bin/phpunit mod_forum_lib_testcase mod/forum/tests/lib_test.php should be enough, that's the broken & fixed stuff.

      Show
      1) Repeat testing instructions from MDL-50993 against all DBs. 2) Run unit tests against all DBs, vendor/bin/phpunit mod_forum_lib_testcase mod/forum/tests/lib_test.php should be enough, that's the broken & fixed stuff.

    Description

      It was detected that one of the CASE statements introduced by MDL-50993 was breaking under oracle, mssql and sqlsrv (link).

      CASE statements cannot be used to build partial/alternative SQL conditions, just to return a value that later (out from the statement) can be evaluated as desired. (link).

      So, here there is a patch that makes unit tests to pass under all databases (link).

      Updated: Mystery was solved, my fault, read comments below. Note that it's really mysterious how unit tests have been passing everywhere (nightly, runs here filling the release testing matrix...) when the query should not have passed ever. If anybody has time to investigate the mystery, great. I have not.

      Ciao

      Attachments

        Issue Links

          Activity

            People

              stronk7 Eloy Lafuente (stronk7)
              stronk7 Eloy Lafuente (stronk7)
              Tim Hunt Tim Hunt
              Andrew Lyons Andrew Lyons
              Rajesh Taneja Rajesh Taneja
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Clockify

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