Issue Details (XML | Word | Printable)

Key: MDL-17868
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Petr Skoda
Reporter: Tim Hunt
Votes: 0
Watchers: 0
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Upgrade fails on some platforms becuase of fractional version numbers

Created: 13/Jan/09 05:33 PM   Updated: Tuesday 02:19 PM
Return to search
Component/s: Database SQL/XMLDB
Affects Version/s: 1.9.3
Fix Version/s: 1.9.4

Issue Links:
Cloners
 

Participants: Andrew Davis, Petr Skoda and Tim Hunt
Security Level: None
QA Assignee: Andrew Davis
Resolved date: 22/Jan/09
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
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.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Petr Skoda added a comment - 13/Jan/09 05:36 PM
going to add following into admin/index.php
$num1 = 2009010200.01;
$num2 = 2009010200.02;

if((string)$num1 === (string)$num2 or $num1 === $num2) {
error ('incorrect float handling detected');
}


Petr Skoda 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
MODIFY admin/index.php   Rev. 1.286.2.26    (+5 -1 lines)
MODIFY lang/en_utf8/admin.php   Rev. 1.154.2.77    (+1 -0 lines)
MODIFY lib/adminlib.php   Rev. 1.153.2.60    (+13 -1 lines)
Petr Skoda 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
MODIFY lib/adminlib.php   Rev. 1.312    (+14 -2 lines)
MODIFY admin/index.php   Rev. 1.351    (+5 -1 lines)
MODIFY lang/en_utf8/admin.php   Rev. 1.256    (+1 -0 lines)
Petr Skoda added a comment - 13/Jan/09 06:06 PM
I have committed a slightly improved detection code into cvs, this should prevent any data loss.
Now we need to describe the problem somewhere in installation docs...

Mitsuhiro Yoshida committed 4 files to 'Lang CVS' - 19/Jan/09 12:03 AM
MDL-17868 MDL-17458 Translated new strings for admin.
MDL-10021 Brushed up a translated help file for resource.
MDL-17878 Adding a new translated lang file for config log.
MODIFY ja_utf8/admin.php   Rev. 1.333    (+5 -3 lines)
MODIFY ja_utf8/help/resource/frameifpossible.html   Rev. 1.4    (+3 -6 lines)
MODIFY ja_utf8/README   Rev. 1.919    (+1 -1 lines)
ADD ja_utf8/report_configlog.php   Rev. 1.1    (+0 -0 lines)
Petr Skoda added a comment - 22/Jan/09 02:30 AM

Petr Skoda 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
MDL-17868 string added
MODIFY fr_utf8/admin.php   Rev. 1.335    (+2 -1 lines)
Tim Hunt made changes - 15/Feb/09 03:15 PM
Link This issue is a clone of MDL-18253 [ MDL-18253 ]
Andrew Davis added a comment - 24/Nov/09 02:17 PM
Closing.

Andrew Davis made changes - 24/Nov/09 02:17 PM
QA Assignee andyjdavis
Andrew Davis made changes - 24/Nov/09 02:19 PM
Status Resolved [ 5 ] Closed [ 6 ]