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

MEDIUMINT returns wrong I_S attributes

    XMLWordPrintable

Details

    Description

      The MEDIUMINT type has the following characteristics depending on signess:

      MEDIUMINT SIGNED    -8388608..8388607   (7 digits,  8 characters)
      MEDIUNINT UNSIGNED        0..16777215   (8 digits,  8 characters)
      

      But these characteristics are not taken into account precisely:

      CREATE OR REPLACE TABLE t1 (a MEDIUMINT, b MEDIUMINT UNSIGNED);
      SELECT COLUMN_NAME, NUMERIC_PRECISION FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA='test' AND TABLE_NAME='t1';
      

      +-------------+-------------------+
      | COLUMN_NAME | NUMERIC_PRECISION |
      +-------------+-------------------+
      | a           |                 7 |
      | b           |                 7 |
      +-------------+-------------------+
      

      Notice, the precision value for UNSIGNED is wrong. It should be 8 digits.

      Attachments

        Issue Links

          Activity

            People

              bar Alexander Barkov
              bar Alexander Barkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 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.