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

Wiki upgrade from 1.9 to 2.0 broken on MSSQL and Oracle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Critical Critical
    • 2.0
    • 2.0
    • Wiki (2.x)
    • None
    • Microsoft SQL, Oracle
    • MOODLE_20_STABLE
    • MOODLE_20_STABLE
    • Moderate

      It seems that wiki upgrade is broken, both for MSSQL and Oracle. The cause is that we are using one harcoded LIMIT clause in upgrade, where that clause simply doesn't exists under those DBs.

      So, the query must be rewritten to avoid the use of any LIMIT clause - using MAX() or whatever. Explicit LIMIT clauses are forbidden.

      Stack trace:

      Debug info: Incorrect syntax near 'LIMIT'.
      INSERT into mdl_wiki_pages (subwikiid, title, cachedcontent, timecreated, timemodified, userid, pageviews) SELECT s.id, p.pagename, ?, p.created, p.lastmodified, p.userid, p.hits FROM mdl_wiki_pages_old p LEFT OUTER JOIN mdl_wiki_entries_old e ON e.id = p.wiki LEFT OUTER JOIN mdl_wiki_subwikis s ON s.wikiid = e.wikiid AND s.groupid = e.groupid AND s.userid = e.userid WHERE p.version = ( SELECT po.version FROM mdl_wiki_pages_old po WHERE p.pagename = po.pagename and p.wiki = po.wiki ORDER BY p.version DESC LIMIT 1)
      [array (
      0 => '*reparse needed*',
      )]
      Stack trace:
      line 381 of /lib/dml/moodle_database.php: dml_write_exception thrown
      line 244 of /lib/dml/mssql_native_moodle_database.php: call to moodle_database->query_end()
      line 651 of /lib/dml/mssql_native_moodle_database.php: call to mssql_native_moodle_database->query_end()
      line 189 of /mod/wiki/db/upgrade.php: call to mssql_native_moodle_database->execute()
      line 510 of /lib/upgradelib.php: call to xmldb_wiki_upgrade()
      line 294 of /lib/upgradelib.php: call to upgrade_plugins_modules()
      line 1266 of /lib/upgradelib.php: call to upgrade_plugins()
      line 260 of /admin/index.php: call to upgrade_noncore()

            dongsheng Dongsheng Cai
            stronk7 Eloy Lafuente (stronk7)
            Nobody Nobody (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

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