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

Comments Plugin error "Invalid column name 'timecreated'"

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • None
    • 2.0.2
    • Comments
    • Moodle 2.0.2+ (Build 20110303); Windows Server 2008 R2; PHP 5.3.5; MS SQL Server 2008 R2
    • Microsoft SQL
    • MOODLE_20_STABLE

      New installation of Moodle 2.0.2 on Windows Server 2008/IIS7/MS SQL. Adding Comments block to main page generates "Database Error" immediately upon initial access to Moodle site; error page prevents normal login. Logging into admin page and hiding the Comments plugin bypasses problem.

      I have traced down the source of the problem to the "limit_to_top_n()" function call from sqlsrv_native_moodle_database->get_recordset_sql(). See full trace in attached file. More specifically the reference to 'timecreated' column in

      SELECT TOP 9223372036854775806 ROW_NUMBER() OVER(ORDER BY timecreated DESC) AS sqlsrvrownumber ...

      needs to use the renamed column name ctimecreated renamed later in the query

      c.timecreated AS ctimecreated

      Is this problem unique to MS SQL Server? Does MySQL allow both a reference to either the original timecreated (non qualified) and the renamed column ctimecreated?

      I have not yet attempted to decode the logic in 'limit_to_top_n'.

            poltawski Dan Poltawski
            shellya@bluffton.edu Art Shelly
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:

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