Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -871,7 +871,9 @@ |
872 | 872 | $db->addQuotes('') . ' OR smw_iw=' . $db->addQuotes(SMW_SQL2_SMWPREDEFIW) . ' GROUP BY smw_id,smw_title,smw_sortkey'; |
873 | 873 | } // else: properties with special tables are ignored for now; maybe fix in the future |
874 | 874 | } |
875 | | - $query = $db->unionQueries($queries, false) . ' ORDER BY smw_sortkey'; // should probably use $db->makeSelectOptions() |
| 875 | + $query = '(' . implode( ') UNION (', $queries ) . ') ORDER BY smw_sortkey'; |
| 876 | + // The following line is possible in MW 1.6 and above only: |
| 877 | + //$query = $db->unionQueries($queries, false) . ' ORDER BY smw_sortkey'; // should probably use $db->makeSelectOptions() |
876 | 878 | if ($requestoptions->limit > 0) { |
877 | 879 | $query = $db->limitResult($query,$requestoptions->limit,($requestoptions->offset > 0 )?$requestoptions->offset:0); |
878 | 880 | } |