
| Key: |
MDL-17868
|
| Type: |
Bug
|
| Status: |
Closed
|
| Resolution: |
Fixed
|
| Priority: |
Critical
|
| Assignee: |
Petr Skoda
|
| Reporter: |
Tim Hunt
|
| Votes: |
0
|
| Watchers: |
0
|
|
|
|
Issue Links:
|
Cloners
|
|
This issue is a clone of:
|
|
MDL-18253
Continuing problems with upgrades and installs because of fractional version numbers
|
|
|
|
|
|
|
|
See http://moodle.org/mod/forum/discuss.php?d=113752
The issue seems to be
(mysql): UPDATE mdl_config SET value = '2.0071E+9' WHERE name = 'version'
Note that the version number has been rounded (value = '2.0071E+9') so the upgrade continues from the wrong place.
http://www.php.net/manual/en/language.types.float.php seems to say that PHP floats always use 15 decimal digits of precision internally, so my diagnosis is that the error occurs when the float is converted to a string somewhere in set_config before it is stored in the DB.
|
|
Description
|
See http://moodle.org/mod/forum/discuss.php?d=113752
The issue seems to be
(mysql): UPDATE mdl_config SET value = '2.0071E+9' WHERE name = 'version'
Note that the version number has been rounded (value = '2.0071E+9') so the upgrade continues from the wrong place.
http://www.php.net/manual/en/language.types.float.php seems to say that PHP floats always use 15 decimal digits of precision internally, so my diagnosis is that the error occurs when the float is converted to a string somewhere in set_config before it is stored in the DB. |
Show » |
committed 3 files to 'Moodle CVS' on branch 'MOODLE_19_STABLE' - 13/Jan/09 06:02 PM
MDL-17868 detection of incorrect hadnling of floats in version numbers - this should prevent dataloss in case it does not work as expected
|
|
|
committed 3 files to 'Moodle CVS' - 13/Jan/09 06:04 PM
MDL-17868 detection of incorrect hadnling of floats in version numbers - this should prevent dataloss in case it does not work as expected; merged from MOODLE_19_STABLE
|
|
|
committed 4 files to 'Lang CVS' - 19/Jan/09 12:03 AM
made changes - 22/Jan/09 02:30 AM
| Field |
Original Value |
New Value |
|
Resolution
|
|
Fixed
[ 1
]
|
|
Status
|
Open
[ 1
]
|
Resolved
[ 5
]
|
martignoni committed 1 file to 'Lang CVS' - 23/Jan/09 06:05 AM
Andrew Davis made changes - 24/Nov/09 02:19 PM
|
Status
|
Resolved
[ 5
]
|
Closed
[ 6
]
|
|
$num1 = 2009010200.01;
$num2 = 2009010200.02;
if((string)$num1 === (string)$num2 or $num1 === $num2) {
error ('incorrect float handling detected');
}