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

MySQL libs assume PHP uses '.' decimal separator

    XMLWordPrintable

Details

    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.8.3, 3.9.2
    • None
    • Database SQL/XMLDB
    • None
    • MySQL
    • 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

            Unassigned Unassigned
            leonstr Leon Stringer
            Andrew Lyons, Huong Nguyen, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze, Stevani Andolo
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: