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

Bad value inserted into a TIME field on truncation

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Duplicate
    • 10.0.3, 5.5.32, 5.3.12
    • 10.3.5
    • Temporal Types
    • None

    Description

      MariaDB [test]> drop table if exists t1; create table t1 (a time); insert into t1 values ('10:20:30'),('10:20:30+'),('2001-01-01 10:20:30'),('2001-01-01 10:20:30+'); show warnings; select * from t1;
      Query OK, 0 rows affected (0.08 sec)
      Query OK, 0 rows affected (0.36 sec)
      Query OK, 4 rows affected, 3 warnings (0.08 sec)
      Records: 4  Duplicates: 0  Warnings: 3
       
      +---------+------+----------------------------------------+
      | Level   | Code | Message                                |
      +---------+------+----------------------------------------+
      | Warning | 1265 | Data truncated for column 'a' at row 2 |
      | Note    | 1265 | Data truncated for column 'a' at row 3 |
      | Warning | 1265 | Data truncated for column 'a' at row 4 |
      +---------+------+----------------------------------------+
      3 rows in set (0.00 sec)
       
      +----------+
      | a        |
      +----------+
      | 10:20:30 |
      | 10:20:30 |
      | 10:20:30 |
      | 34:20:30 |
      +----------+
      4 rows in set (0.00 sec)

      The last value '34:20:30' is wrong.
      The expected value is '10:20:30'.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Git Integration

                  Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.