-
Bug
-
Resolution: Fixed
-
Critical
-
2.0
-
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()
- will be (partly) resolved by
-
MDL-24862 Unable to upgrade moodle database (upgrading to 2.0) due to MSSQL incompatible SQL command (mod_wiki)
-
- Closed
-