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

postgres sql like queries resulting in significant number of warning messages in database log files

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.2.3
    • 2.3
    • Database SQL/XMLDB
    • None
    • MOODLE_22_STABLE
    • MOODLE_23_STABLE
    • w20_MDL-32907_m23_like
    • Hide

      1/ set escape_string_warning on and standard_conforming_strings off
      2/ execute phpunit tests on PostgreSQL 8.3 and 9.1
      3/ set escape_string_warning off and standard_conforming_strings on
      4/ execute phpunit tests on PostgreSQL 8.3 and 9.1 again

      Show
      1/ set escape_string_warning on and standard_conforming_strings off 2/ execute phpunit tests on PostgreSQL 8.3 and 9.1 3/ set escape_string_warning off and standard_conforming_strings on 4/ execute phpunit tests on PostgreSQL 8.3 and 9.1 again

    Description

      With postgres, database logs are filling up with a significant number of the following warnings. This appears to have got worse with Moodle 2.2.2, and appears to be related to significant changes to the increased use of contexts for this release.

      2012-05-09 00:09:46 WARNING: nonstandard use of
      in a string literal at character 1142
      2012-05-09 00:09:46 HINT: Use the escape string syntax for backslashes, e.g., E'
      '.

      This is the basically the same issue as MDL-27685 where the postgres ESCAPE character was changed from '\' to '|'

      The cause of the warnings is due to the default value for the ESCAPE character for postgres in the function definition "public function sql_like($fieldname, $param, $casesensitive = true, $accentsensitive = true, $notlike = false, $escapechar = '\')" in file "lib/dml/pgsql_native_moodle_database.php. We are of the opinion the default escape character should be changed to '|' rather than '\' for this function as well the corresponding change for MDL-27685.

      Attachments

        Issue Links

          Activity

            People

              skodak Petr Skoda
              derekw Derek Woolhead
              Aparup Banerjee Aparup Banerjee
              Dan Poltawski Dan Poltawski
              David Woloszyn, Huong Nguyen, Jake Dallimore, Meirza, Michael Hawkins, Raquel Ortega, Safat Shahin, Stevani Andolo
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                25/Jun/12