Ilmari Karonen wrote:
Simetrical wrote:
On Tue, Jul 22, 2008 at 6:37 PM, vyznev@svn.wikimedia.org wrote:
// need to resort and relimit after union
$sql = "(" . implode( ") UNION (", $subsql ) . ") ORDER BY rc_timestamp DESC LIMIT {$limit}";
Does this actually work in MySQL 4? I think you need to retrieve them all and do the ordering in PHP, the way it's done in WhatLinksHere.
Well, Special:RecentChanges already uses a similar trick (grep for "($sqlNew) UNION ($sqlOld)"), so I assumed it works. Haven't actually tested it on MySQL 4, though.
Just dug through the history, and the use of "UNION" in Recentchanges goes back to r34710 committed by aaron on May 13. So I suppose it may have been broken since then, but it sounds unlikely.