r54203 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54202‎ | r54203 | r54204 >
Date:12:37, 2 August 2009
Author:mkroetzsch
Status:deferred
Tags:
Comment:
ensure that getPropertyValues returns only distinct results
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php
@@ -361,7 +361,7 @@
362362 case SMW_SQL2_TEXT2:
363363 $res = $db->select( 'smw_text2', 'value_blob',
364364 'p_id=' . $db->addQuotes($pid),
365 - 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions) );
 365+ 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions) ); ///NOTE: Do not add DISTINCT here for performance reasons
366366 while($row = $db->fetchObject($res)) {
367367 $dv = SMWDataValueFactory::newPropertyObjectValue($property);
368368 $dv->setOutputFormat($outputformat);
@@ -375,7 +375,7 @@
376376 'smw_namespace, smw_title, smw_iw',
377377 'p_id=' . $db->addQuotes($pid) . ' AND o_id=smw_id' .
378378 $this->getSQLConditions($requestoptions,'smw_sortkey','smw_sortkey'),
379 - 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,'smw_sortkey') );
 379+ 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,'smw_sortkey') + array('DISTINCT') );
380380 while($row = $db->fetchObject($res)) {
381381 $dv = SMWDataValueFactory::newPropertyObjectValue($property);
382382 $dv->setOutputFormat($outputformat);
@@ -396,7 +396,7 @@
397397 $res = $db->select( 'smw_atts2', 'value_unit, value_xsd',
398398 'p_id=' . $db->addQuotes($pid) .
399399 $this->getSQLConditions($requestoptions,$value_column,'value_xsd'),
400 - 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,$value_column) );
 400+ 'SMW::getPropertyValues', $this->getSQLOptions($requestoptions,$value_column) + array('DISTINCT') );
401401 while($row = $db->fetchObject($res)) {
402402 $dv = SMWDataValueFactory::newPropertyObjectValue($property);
403403 $dv->setOutputFormat($outputformat);

Status & tagging log