Uploaded image for project: 'Moodle Community Sites'
  1. Moodle Community Sites
  2. MDLSITE-3530

DB error in postgres at moodle.net/sites/

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Low
    • Resolution: Fixed
    • archive.moodle.net
    • None

    Description

      This is almost certainly a postgres error. Postgres is more strict than mysql so this isn't an urgent fix but it would be nice to work under the more strict database.

      Debug info: ERROR: function sum(boolean) does not exist
      LINE 1: ...countrycode as country, COUNT('x') AS totalcount, SUM(privac...
      ^
      HINT: No function matches the given name and argument types. You might need to add explicit type casts.
      SELECT r.countrycode as country, COUNT('x') AS totalcount, SUM(privacy = 'named' or privacy = 'linked') AS publiccount
      FROM mdl_registry r
      WHERE r.timeregistered > 0 AND
      r.timeregistered < $1 AND
      r.confirmed = 1 AND
      (r.unreachable <= $2 OR r.override BETWEEN 1 AND 3)
      GROUP BY r.countrycode
      HAVING (COUNT('x')) > 0
      ORDER BY (COUNT('x')) DESC
      [array (
      0 => 1412118000,
      1 => 2,
      )]
      Error code: dmlreadexception
      Stack trace:
      line 443 of /lib/dml/moodle_database.php: dml_read_exception thrown
      line 244 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()
      line 764 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()
      line 21 of /local/moodleorg/top/sites/siteslib.php: call to pgsql_native_moodle_database->get_records_sql()
      line 12 of /local/moodleorg/top/sites/index.php: call to get_combined_country_info()

      Attachments

        Issue Links

          Activity

            People

              andyjdavis Andrew Davis
              andyjdavis Andrew Davis
              Mary Cooch
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: