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

Inconsistent behaviors when casting into time

    XMLWordPrintable

Details

    • Unexpected results
    • Q1/2026 Server Maintenance

    Description

      An inconsistent result is returned when casting a truncate value into time.

      DROP TABLE t1;
      CREATE TABLE t1 (c1 CHAR(20));
      INSERT INTO t1 VALUES (9430886);
      SELECT (CAST(c1 AS TIME)) FROM t1; -- {NULL}
      

      DROP TABLE t1;
      CREATE TABLE t1 (c1 MEDIUMINT UNSIGNED);
      INSERT INTO t1 VALUES (9430886);
      SELECT (CAST(c1 AS TIME)) FROM t1; -- actual: {838:59:59}, expected: {null}
      

      Attachments

        Issue Links

          Activity

            People

              serg Sergei Golubchik
              John Jove John Jove
              Sergei Golubchik Sergei Golubchik
              Alexander Barkov Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              4 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.