|
From: <cw...@us...> - 2007-06-20 10:33:12
|
Revision: 452
http://rdfapi-php.svn.sourceforge.net/rdfapi-php/?rev=452&view=rev
Author: cweiske
Date: 2007-06-20 03:33:05 -0700 (Wed, 20 Jun 2007)
Log Message:
-----------
Fix change in behavior of mysql-5.0.42 that makes decimal default to 0
digits after decimal point
Modified Paths:
--------------
trunk/rdfapi-php/api/sparql/SparqlEngineDb/FilterGenerator.php
trunk/rdfapi-php/api/sparql/SparqlEngineDb/SqlGenerator.php
Modified: trunk/rdfapi-php/api/sparql/SparqlEngineDb/FilterGenerator.php
===================================================================
--- trunk/rdfapi-php/api/sparql/SparqlEngineDb/FilterGenerator.php 2007-06-20 09:13:20 UTC (rev 451)
+++ trunk/rdfapi-php/api/sparql/SparqlEngineDb/FilterGenerator.php 2007-06-20 10:33:05 UTC (rev 452)
@@ -230,7 +230,7 @@
'('
. "(($cType = '' || $cType = '$xsd#string') AND $cValue != '')"
. " OR ($cType = '$xsd#boolean' AND $cValue != 'false')"
- . " OR (($cType = '$xsd#integer' || $cType = '$xsd#double') AND CAST($cValue AS DECIMAL) != 0)"
+ . " OR (($cType = '$xsd#integer' || $cType = '$xsd#double') AND CAST($cValue AS DECIMAL(15,10)) != 0)"
//plain check for all unknown datatypes
. " OR ($cType != '' AND $cType != '$xsd#string' AND $cType != '$xsd#boolean' AND $cType != '$xsd#integer' AND $cType != '$xsd#double' AND $cValue != '')"
. ')',
@@ -304,7 +304,7 @@
. ' OR ' . $strColDatatype . ' = "' . self::$typeXsdInteger . '"'
. ')';
return $strIsNull . '('
- . 'CAST(' . $val1 . ' AS DECIMAL)'
+ . 'CAST(' . $val1 . ' AS DECIMAL(15,10))'
. ' ' . $tree['operator'] . ' '
. $val2
. $strExtra
Modified: trunk/rdfapi-php/api/sparql/SparqlEngineDb/SqlGenerator.php
===================================================================
--- trunk/rdfapi-php/api/sparql/SparqlEngineDb/SqlGenerator.php 2007-06-20 09:13:20 UTC (rev 451)
+++ trunk/rdfapi-php/api/sparql/SparqlEngineDb/SqlGenerator.php 2007-06-20 10:33:05 UTC (rev 452)
@@ -628,7 +628,7 @@
if ($bject->dtype == 'http://www.w3.org/2001/XMLSchema#integer'
|| $bject->dtype == 'http://www.w3.org/2001/XMLSchema#double'
) {
- $strVariable = 'CAST(' . $strTablePrefix . '.' . $strType . ' AS DECIMAL)';
+ $strVariable = 'CAST(' . $strTablePrefix . '.' . $strType . ' AS DECIMAL(15,10))';
$strValue = $bject->getLabel();
} else {
$strVariable = $strTablePrefix . '.' . $strType;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|