Actions
Bug #80978
closedTYPO3 Query Builder: not able to compare floating point numbers (except equal)!
Status:
Closed
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2017-04-24
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
8
PHP Version:
7.1
Tags:
Complexity:
Is Regression:
Yes
Sprint Focus:
Description
Hi,
it takes me hours to find out that all comparisons numbers parsed to Integer!!!
Please also take care of floating point numbers when you convert the TYPO3 QueryBuilder to Doctrine QueryBilder in Typo3DbQueryParser class.
Bug-Snippet of Typo3DbQueryParser.php:
case QueryInterface::OPERATOR_LESS_THAN:
$value = $this->queryBuilder->createNamedParameter($this->dataMapper->getPlainValue($value), \PDO::PARAM_INT);
$expr = $exprBuilder->comparison($fieldName, $exprBuilder::LT, $value);
break;
case QueryInterface::OPERATOR_LESS_THAN_OR_EQUAL_TO:
$value = $this->queryBuilder->createNamedParameter($this->dataMapper->getPlainValue($value), \PDO::PARAM_INT);
$expr = $exprBuilder->comparison($fieldName, $exprBuilder::LTE, $value);
break;
case QueryInterface::OPERATOR_GREATER_THAN:
$value = $this->queryBuilder->createNamedParameter($this->dataMapper->getPlainValue($value), \PDO::PARAM_INT);
$expr = $exprBuilder->comparison($fieldName, $exprBuilder::GT, $value);
break;
case QueryInterface::OPERATOR_GREATER_THAN_OR_EQUAL_TO:
$value = $this->queryBuilder->createNamedParameter($this->dataMapper->getPlainValue($value), \PDO::PARAM_INT);
$expr = $exprBuilder->comparison($fieldName, $exprBuilder::GTE, $value);
break;
Actions