Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: Behaviors
-
Labels:None
-
Environment:Doctrine 1.2.2
Description
The problem was already described by another person at http://www.doctrine-project.org/jira/browse/DC-385
and was fixed but now is broken again.
When using the Geographical behaviour in a YML schema the latitude is stored in Mysql as a Double(18,2) instead of a Double as it was in the previous versions. It appears that all doubles in yml are defaulting to (18,2).
The problem lies in DataDict/Mysql.php
Previously it was:
case 'double':
return 'DOUBLE';
now it's:
case 'double':
$length = !empty($field['length']) ? $field['length'] : 18;
$scale = !empty($field['scale']) ? $field['scale'] : $this->conn->getAttribute(Doctrine_Core::ATTR_DECIMAL_PLACES);
return 'DOUBLE('.$length.', '.$scale.')';
Perhaps this could be improved so that if there is no length specified it returns just double with no length or scale instead of defaulting to 18, ATTR_DECIMAL_PLACES? I expect that most people that use the double type in yaml wouldn't want only 2 decimals.