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

Wiki upgrade from 1.9 to 2.0 broken on MSSQL and Oracle

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Component/s: Wiki (2.x)
    • Labels:
      None
    • Database:
      Microsoft SQL, Oracle
    • Difficulty:
      Moderate
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      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()

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    24/Nov/10