Moodle

Continuing problems with upgrades and installs because of fractional version numbers

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9.4
  • Fix Version/s: 1.9.5
  • Component/s: Database SQL/XMLDB
  • Labels:
    None
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

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.

Issue Links

Activity

Hide
Tim Hunt added a comment -

I've created a clone because this thread: http://moodle.org/mod/forum/discuss.php?d=114945 has interesting new information.

Someone, who got the new warning, posted their phpinfo, and the thing that leaps out at me is that there is a php.ini settings 'precision' (http://php.net/manual/en/ini.core.php#ini.precision) which is 14 by default, but on their server is set to 6.

I'll ask them to try setting it back to 14. If that fixes the issue, we can put an ini_set call in the code, and deal with the problem once and for all.

Show
Tim Hunt added a comment - I've created a clone because this thread: http://moodle.org/mod/forum/discuss.php?d=114945 has interesting new information. Someone, who got the new warning, posted their phpinfo, and the thing that leaps out at me is that there is a php.ini settings 'precision' (http://php.net/manual/en/ini.core.php#ini.precision) which is 14 by default, but on their server is set to 6. I'll ask them to try setting it back to 14. If that fixes the issue, we can put an ini_set call in the code, and deal with the problem once and for all.
Hide
Petr Škoda (skodak) added a comment -

ini_set is a good idea!

Show
Petr Škoda (skodak) added a comment - ini_set is a good idea!
Hide
Petr Škoda (skodak) added a comment -

I have added the ini_set into lib/setup.php because we depend on that in gradebook and upgrade, I hope it will solve it once and for all
please reopen in case of any problems, thanks a lot!

Show
Petr Škoda (skodak) added a comment - I have added the ini_set into lib/setup.php because we depend on that in gradebook and upgrade, I hope it will solve it once and for all please reopen in case of any problems, thanks a lot!
Hide
Tim Hunt added a comment -

Well, we don't now for sure it is the cause of the problem. I will make a simple test script with ini_set('precision', 6); to confirm that this was the cause.

Show
Tim Hunt added a comment - Well, we don't now for sure it is the cause of the problem. I will make a simple test script with ini_set('precision', 6); to confirm that this was the cause.
Hide
Tim Hunt added a comment -

Having done the test, it does seem that this was the problem.

Show
Tim Hunt added a comment - Having done the test, it does seem that this was the problem.
Hide
Andrew Davis added a comment -

Between setting a high level of precision and doing a safety check just in case we should be well covered. Closing.

Show
Andrew Davis added a comment - Between setting a high level of precision and doing a safety check just in case we should be well covered. Closing.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: