MariaDB Development
  1. MariaDB Development
  2. MDEV-4900

Bad value inserted into a TIME field on truncation

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 10.0.3, 5.5.32, 5.3.12
    • Fix Version/s: None
    • Labels:
      None
    • Global Rank:
      3468

      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'.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Alexander Barkov
            Reporter:
            Alexander Barkov
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: