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

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

    XMLWordPrintable

Details

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

    Description

      DROP TABLE IF EXISTS t1;
      CREATE TABLE t1 AS SELECT
        CAST(1.1111111111 AS SIGNED) AS c1,
        CAST(1.1111111111 AS UNSIGNED) AS c2;
      DESC t1;
      

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

      Looks wrong:

      • the data type is wrong. It should be int instead of bigint
      • the length is too large. It should be around 1.

      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.