[MDEV-15926] MEDIUMINT returns wrong I_S attributes Created: 2018-04-19  Updated: 2018-04-20  Resolved: 2018-04-20

Status: Closed
Project: MariaDB Server
Component/s: Data types, Information Schema
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3
Fix Version/s: 10.3.7

Type: Bug Priority: Major
Reporter: Alexander Barkov Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Blocks
blocks MDEV-4912 Data type plugin API version 1 Closed
Relates
relates to MDEV-13232 Assertion `(&(&share->intern_lock)->m... Closed
relates to MDEV-15946 MEDIUMINT(N<8) creates a wrong data t... Closed

 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.


Generated at Thu Feb 08 08:25:03 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.