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

Inconsistent handling of datetime literals containing a timezone

    Details

    • Type: Bug
    • Status: Confirmed (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4, 10.2.18, 10.3.9
    • Fix Version/s: 10.3, 10.4
    • Component/s: Temporal Types
    • Labels:
      None

      Description

      When I have a DATE(TIME) column as a PK (or part of PK) and I try to SELECT a specific row using a datetime string which contains a timezone part, a warning is issued for "truncated incorrect datetime value" and the row is found.
      When I try to do an UPDATE with the same WHERE condition, I get no warning, no error and the row is not updated.
      When the column is not the PK, the UPDATE throws an error instead of silently ignoring it.

      https://dbfiddle.uk/?rdbms=mariadb_10.3&fiddle=eee4fdbc49ec5abbe708e64e36c32848
      https://dbfiddle.uk/?rdbms=mariadb_10.3&fiddle=8b72eedd6f43b794ed6edf9bc8740265

      MySQL 5.6 seems to work without errors in http://sqlfiddle.com/#!9/9cffea/1 and https://www.db-fiddle.com/f/fA8ZG3px1XQdd8ANxCt6Xp/0
      MySQL 5.7 and 8.0 on the other hand throw the error even when the column is the PK - https://www.db-fiddle.com/f/fA8ZG3px1XQdd8ANxCt6Xp/1.

        Attachments

          Activity

            People

            • Assignee:
              bar Alexander Barkov
              Reporter:
              jkavalik Jiri Kavalik
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated: