r63162 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63161‎ | r63162 | r63163 >
Date:08:53, 2 March 2010
Author:mkroetzsch
Status:deferred (Comments)
Tags:
Comment:
avoid unionQueries() since it is available only in MW 1.6
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -871,7 +871,9 @@
872872 $db->addQuotes('') . ' OR smw_iw=' . $db->addQuotes(SMW_SQL2_SMWPREDEFIW) . ' GROUP BY smw_id,smw_title,smw_sortkey';
873873 } // else: properties with special tables are ignored for now; maybe fix in the future
874874 }
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()
876878 if ($requestoptions->limit > 0) {
877879 $query = $db->limitResult($query,$requestoptions->limit,($requestoptions->offset > 0 )?$requestoptions->offset:0);
878880 }

Comments

#Comment by MaxSem (talk | contribs)   12:00, 2 March 2010

But why? You're breaking compatibility with other databases, while SMW states that MW at least 1.11 is required.

Status & tagging log