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

Operator II does not exist (postgresql)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0.2
    • Labels:
    • Environment:
      Ubuntu 10.04 LTS, Postgresql 8.4.5 Apache 2.2.14
    • Database:
      PostgreSQL
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Site Administration -> Reports -> Statistics does not work (Error reading from database).
      Error on the apache log and postgresql log say:

      [Fri Dec 17 13:50:50 2010] [error] [client 142.244.122.135] Default exception handler: Error reading from database Debug: ERROR: operator does not exist: bigint || bigint\nLINE 1: SELECT timeend || roleid AS uniqueid, timeend, roleid, sum...\n ^\nHINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.\nSELECT timeend || roleid AS uniqueid, timeend, roleid, sum(stat1+stat2) as line1 FROM mdl_stats_daily WHERE stattype = 'activity' AND timeend >= 1291964400 GROUP BY timeend,roleid ORDER BY timeend DESC\n[array (\n)]\n* line 391 of /lib/dml/moodle_database.php: dml_read_exception thrown\n* line 229 of /lib/dml/pgsql_native_moodle_database.php: call to moodle_database->query_end()\n* line 669 of /lib/dml/pgsql_native_moodle_database.php: call to pgsql_native_moodle_database->query_end()\n* line 101 of /course/report/stats/report.php: call to pgsql_native_moodle_database->get_records_sql()\n* line 62 of /course/report/stats/index.php: call to require()\n, referer: https://eclass-pilot-test.srv.ualberta.ca/course/report/stats/index.php

      Suggestion: Replace logical OR operator from "||" to "OR" so it will work on both postgresql and mysql db. I'm not a 100% sure what the query is trying to achieve, but it appears to be used as a logical OR operator.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  21/Feb/11