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

ALTER from DOUBLE to TIME returns a wrong result

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
    • 10.4
    • Data types, Temporal Types
    • None

    Description

      This script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a TIME);
      INSERT INTO t1 VALUES (0.999e19);
      SELECT * FROM t1;

      correctly returns:

      +-----------+
      | a         |
      +-----------+
      | 838:59:59 |
      +-----------+

      This script:

      DROP TABLE IF EXISTS t1,t2;
      CREATE TABLE t1 (a TIME);
      CREATE TABLE t2 (a DOUBLE);
      INSERT INTO t2 VALUES (0.999e19);
      INSERT INTO t1 SELECT a FROM t2;
      SELECT * FROM t1;

      also correctly returns:

      +-----------+
      | a         |
      +-----------+
      | 838:59:59 |
      +-----------+

      This script:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DOUBLE);
      INSERT INTO t1 VALUES (0.999e19);
      ALTER TABLE t1 MODIFY a TIME;
      SELECT * FROM t1;

      erroneously returns

      +----------+
      | a        |
      +----------+
      | 00:00:00 |
      +----------+

      The expected result is 838:59:59, like in the previous two scripts.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:

              Git Integration

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