Uploaded image for project: 'MariaDB ColumnStore'
  1. MariaDB ColumnStore
  2. MCOL-4419

MAKETIME() returns a wrong result for DECIMAL input

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 5.4.3, 5.5.2, 5.6.1, 6.1.1
    • Icebox
    • PrimProc

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DECIMAL(18,7)) ENGINE=ColumnStore;
      INSERT INTO t1 VALUES (50.1);
      INSERT INTO t1 VALUES (50.12);
      INSERT INTO t1 VALUES (50.123);
      INSERT INTO t1 VALUES (50.1234);
      INSERT INTO t1 VALUES (50.12345);
      INSERT INTO t1 VALUES (50.123456);
      INSERT INTO t1 VALUES (50.1234567);
      SELECT MAKETIME(0,0,a) FROM t1;
      

      +-----------------+
      | MAKETIME(0,0,a) |
      +-----------------+
      | 00:00:50.000000 |
      | 00:00:50.000000 |
      | 00:00:50.000000 |
      | 00:00:50.000000 |
      | 00:00:50.000000 |
      | 00:00:50.000000 |
      | 00:00:50.000000 |
      +-----------------+
      

      This result looks wrong.

      The correct result is:

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 (a DECIMAL(18,7)) ENGINE=MyISAM;
      INSERT INTO t1 VALUES (50.1);
      INSERT INTO t1 VALUES (50.12);
      INSERT INTO t1 VALUES (50.123);
      INSERT INTO t1 VALUES (50.1234);
      INSERT INTO t1 VALUES (50.12345);
      INSERT INTO t1 VALUES (50.123456);
      INSERT INTO t1 VALUES (50.1234567);
      SELECT MAKETIME(0,0,a) FROM t1;
      

      +-----------------+
      | MAKETIME(0,0,a) |
      +-----------------+
      | 00:00:50.100000 |
      | 00:00:50.120000 |
      | 00:00:50.123000 |
      | 00:00:50.123400 |
      | 00:00:50.123450 |
      | 00:00:50.123456 |
      | 00:00:50.123456 |
      +-----------------+
      

      Attachments

        Issue Links

          Activity

            People

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