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

Inserting a huge number into a TIME column produces a wrong result

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • 10.0.3, 5.5.32, 5.3.12
    • N/A
    • N/A
    • None
    • Not for Release Notes

    Description

      MariaDB [test]> DROP TABLE IF EXISTS t1; CREATE TABLE t1 (a TIME); INSERT INTO t1 VALUES (100000000000000000); SHOW WARNINGS; SELECT * FROM t1;
      Query OK, 0 rows affected (0.00 sec)
       
      Query OK, 0 rows affected (0.07 sec)
       
      Query OK, 1 row affected, 1 warning (0.00 sec)
       
      +---------+------+----------------------------------------+
      | Level   | Code | Message                                |
      +---------+------+----------------------------------------+
      | Warning | 1265 | Data truncated for column 'a' at row 1 |
      +---------+------+----------------------------------------+
      1 row in set (0.00 sec)
       
      +----------+
      | a        |
      +----------+
      | 00:00:00 |
      +----------+
      1 row in set (0.00 sec)

      The expected result is 'maximum possible value', which is '838:59:59'.

      MySQL 5.5 and 5.6 correctly insert the maximum possible value.

      Attachments

        Activity

          People

            bar Alexander Barkov
            bar Alexander Barkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 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.