Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-4627

ISO8601 strings not allowed as datetime input

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Incomplete
    • Affects Version/s: 5.5.31
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      CentOS 6.4 x64

      Description

      When trying to input an ISO8601 string as a datetime value, the SQL query fails.

      UPDATE `users` SET `activity` = '2013-06-07T18:15:51+0800' WHERE id = '1';
      Invalid datetime format: 1292 Incorrect datetime value: '2013-06-07T18:15:51+0800' for column 'activity' at row 1
      

      This works in MySQL 5.5 (tried with 5.5.29).

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            serg Sergei Golubchik added a comment -

            I cannot repeat it. Both in MySQL and in MariaDB I get a warning, and the value is updated.

            In MySQL the warning is "Out of range value for column 'activity' at row 1" in MariaDB the warnings is "Data truncated for column 'activity' at row 1". Our warning is correct, there's nothing "out of range" here, instead the string-to-time conversion routine does not understand time zones (neither in MySQL nor in MariaDB), so the resulting datetime value comes from a truncated string.

            Could you provide a complete repeatable test case that shows the incorrect behavior?

            Show
            serg Sergei Golubchik added a comment - I cannot repeat it. Both in MySQL and in MariaDB I get a warning, and the value is updated. In MySQL the warning is "Out of range value for column 'activity' at row 1" in MariaDB the warnings is "Data truncated for column 'activity' at row 1". Our warning is correct, there's nothing "out of range" here, instead the string-to-time conversion routine does not understand time zones (neither in MySQL nor in MariaDB), so the resulting datetime value comes from a truncated string. Could you provide a complete repeatable test case that shows the incorrect behavior?
            Hide
            elenst Elena Stepanova added a comment -

            Please also check that you have the same sql_mode value in your MariaDB and MySQL configuration. "Incorrect datetime value" error is something you'd get in a strict mode, e.g. with STRICT_ALL_TABLES (again, both with MySQL and MariaDB).

            Show
            elenst Elena Stepanova added a comment - Please also check that you have the same sql_mode value in your MariaDB and MySQL configuration. "Incorrect datetime value" error is something you'd get in a strict mode, e.g. with STRICT_ALL_TABLES (again, both with MySQL and MariaDB).

              People

              • Assignee:
                serg Sergei Golubchik
                Reporter:
                dataviruset Oskar Levin
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Due:
                  Created:
                  Updated:
                  Resolved: