Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-68879

MySQL libs assume PHP uses '.' decimal separator

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.8.3, 3.9.2
    • Fix Version/s: None
    • Component/s: Database SQL/XMLDB
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_38_STABLE, MOODLE_39_STABLE

      Description

      In emulate_bound_params() in lib/dml/mysqli_native_moodle_database.php float values get added to SQL statements using string append. This assumes PHP will use the same decimal separator as the DBMS and that this separator will not be a delimiter in SQL.

      However, in some cases it appears that PHP uses the locale's decimal separator. If this separator is a ',' this results in Moodle trying to execute an invalid SQL statement. Examples of this from the forums:

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            leonstr Leon Stringer
            Participants:
            Component watchers:
            Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: