Permalink
Browse files

[MDL-22553]

Fixing problems with sql sentences using LIMIT
  • Loading branch information...
1 parent 07a27d8 commit 2dd18a9323a32a147a2e6ceb10ab8852a086291b Jordi Piguillem committed May 25, 2010
Showing with 2 additions and 3 deletions.
  1. +2 −3 mod/wiki/db/upgrade.php
View
5 mod/wiki/db/upgrade.php
@@ -178,12 +178,11 @@ function xmldb_wiki_upgrade($oldversion) {
'LEFT OUTER JOIN {wiki_subwikis} s ' .
'ON s.wikiid = e.wikiid AND s.groupid = e.groupid AND s.userid = e.userid ' .
'WHERE p.version = (' .
- ' SELECT po.version ' .
+ ' SELECT max(po.version) ' .
' FROM {wiki_pages_old} po ' .
' WHERE p.pagename = po.pagename and ' .
' p.wiki = po.wiki ' .
- ' ORDER BY p.version DESC ' .
- ' LIMIT 1)';
+ ' )';
echo $OUTPUT->notification('Migrating old pages to new pages', 'notifysuccess');
$DB->execute($sql, array('**reparse needed**'));

0 comments on commit 2dd18a9

Please sign in to comment.