r66043 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66042‎ | r66043 | r66044 >
Date:19:34, 7 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Follow up to r66017
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2_Queries.php
@@ -622,7 +622,7 @@
623623 $keys = $dv->getDBkeys();
624624
625625 // Try comparison based on value field and comparator.
626 - if ( ( $valueIndexes[0] >= 0 ) && ( $description->getComparator() != SMW_CMP_EQ ) ) { // TODO //.//
 626+ if ( ( $valueIndexes[0] >= 0 ) ) { // TODO //.//
627627 // Find field name for comparison.
628628 $smwidjoinfield = false;
629629 $fieldNames = $this->getDBFieldsForDVIndexes( $proptable->objectfields, $valueIndexes, $smwidjoinfield );
@@ -634,13 +634,14 @@
635635 // TODO: refactor this hook away by using a method in the description classes
636636
637637 switch ( $description->getComparator() ) {
 638+ case SMW_CMP_EQ: $comp = '='; break;
638639 case SMW_CMP_LEQ: $comp = '<='; break;
639640 case SMW_CMP_GEQ: $comp = '>='; break;
640641 case SMW_CMP_NEQ: $comp = '!='; break;
641642 }
642643
643644 wfRunHooks( 'smwGetSQLConditionForValue', array( &$where, $description, $query->alias, $fieldNames, $this->m_dbs ) );
644 -
 645+
645646 if ( $where == '' ) {
646647 $value = $keys[$valueIndexes[0]]; // TODO //.//
647648 $where = "{$query->alias}.{$fieldNames[0]}{$comp}" . $this->m_dbs->addQuotes( $value );
@@ -662,11 +663,12 @@
663664 $i++;
664665 }
665666 }
 667+
666668 } elseif ( ( $description instanceof SMWConjunction ) || ( $description instanceof SMWDisjunction ) ) {
667669 $op = ( $description instanceof SMWConjunction ) ? 'AND' : 'OR';
668670 foreach ( $description->getDescriptions() as $subdesc ) {
669671 // $where .= ($where!=''?$op:'') .
670 - $this->compileAttributeWhere( $query, $subdesc, $proptable, $valueindex, $op );
 672+ $this->compileAttributeWhere( $query, $subdesc, $proptable, $valueIndexes, $op );
671673 }
672674 }
673675 if ( $where != '' ) $query->where .= ( $query->where ? " $operator ":'' ) . "($where)";

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r66017Changes for 1.5.1...jeroendedauw14:07, 7 May 2010

Status & tagging log