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

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

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 10.2, 10.3
    • Fix Version/s: 10.3, 10.4
    • Component/s: Data types
    • Labels:
      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

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

                Dates

                • Created:
                  Updated: