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

Wrong field type for CAST(temporal_column AS [UN]SIGNED)

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2, 10.3
    • 10.4
    • Data types
    • None

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 AS SELECT
        CAST(TIME'10:10:10.123456' AS SIGNED) AS c1,
        CAST(TIME'10:10:10.123456' AS UNSIGNED) AS c2;
      DESC t1;
      

      +-------+---------------------+------+-----+---------+-------+
      | Field | Type                | Null | Key | Default | Extra |
      +-------+---------------------+------+-----+---------+-------+
      | c1    | bigint(17)          | NO   |     | NULL    |       |
      | c2    | bigint(20) unsigned | NO   |     | NULL    |       |
      +-------+---------------------+------+-----+---------+-------+
      

      Looks excessive. TIME can have only 7 digits in the integer part: hhhmmss.

      Attachments

        Issue Links

          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.