Index: trunk/extensions/SemanticMediaWiki/includes/storage/SMW_SQLStore2.php |
— | — | @@ -385,11 +385,11 @@ |
386 | 386 | $db->freeResult($res); |
387 | 387 | break; |
388 | 388 | case SMW_SQL2_ATTS2: |
389 | | - if ( ($requestoptions !== NULL) && ($requestoptions->boundary !== NULL) && |
390 | | - ($requestoptions->boundary->isNumeric()) ) { |
391 | | - $value_column = 'value_num'; |
392 | | - } else { |
393 | | - $value_column = 'value_xsd'; |
| 389 | + if ( ($requestoptions !== NULL) && ($requestoptions->boundary !== NULL) ) { // the quick way to find out if this is a numeric type |
| 390 | + $value_column = $requestoptions->boundary->isNumeric()?'value_num':'value_xsd'; |
| 391 | + } else { // need to do more work to find out if this is a numeric type |
| 392 | + $testval = SMWDatavalueFactory::newTypeIDValue($property->getPropertyTypeID()); |
| 393 | + $value_column = $testval->isNumeric()?'value_num':'value_xsd'; |
394 | 394 | } |
395 | 395 | $sql = 'p_id=' . $db->addQuotes($pid) . |
396 | 396 | $this->getSQLConditions($requestoptions,$value_column,'value_xsd'); |