Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
5.5(EOL), 10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL)
-
None
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
- blocks
-
MDEV-4912 Data type plugin API version 1
-
- Closed
-
- relates to
-
MDEV-13232 Assertion `(&(&share->intern_lock)->m_mutex)->count > 0 && pthread_equal(pthread_self(), (&(&share->intern_lock)->m_mutex)->thread)' failed in _ma_state_info_write
-
- Closed
-
-
MDEV-15946 MEDIUMINT(N<8) creates a wrong data type on conversion to string
-
- Closed
-
Activity
Link |
This issue relates to |
Description |
The MEDIUMINT type has the following characteristics depending on signess:
{noformat} MEDIUMINT SIGNED -8388608..8388607 (7 digits, 8 characters) MEDIUNINT UNSIGNED 0..16777215 (8 gigits, 8 characters) {noformat} {code:sql} 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'; {code} {noformat} +-------------+-------------------+ | COLUMN_NAME | NUMERIC_PRECISION | +-------------+-------------------+ | a | 7 | | b | 7 | +-------------+-------------------+ {noformat} Notice, the precision value for {{UNSIGNED}} is wrong. It should be {{8}} digits. |
The MEDIUMINT type has the following characteristics depending on signess:
{noformat} MEDIUMINT SIGNED -8388608..8388607 (7 digits, 8 characters) MEDIUNINT UNSIGNED 0..16777215 (8 digits, 8 characters) {noformat} {code:sql} 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'; {code} {noformat} +-------------+-------------------+ | COLUMN_NAME | NUMERIC_PRECISION | +-------------+-------------------+ | a | 7 | | b | 7 | +-------------+-------------------+ {noformat} Notice, the precision value for {{UNSIGNED}} is wrong. It should be {{8}} digits. |
Description |
The MEDIUMINT type has the following characteristics depending on signess:
{noformat} MEDIUMINT SIGNED -8388608..8388607 (7 digits, 8 characters) MEDIUNINT UNSIGNED 0..16777215 (8 digits, 8 characters) {noformat} {code:sql} 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'; {code} {noformat} +-------------+-------------------+ | COLUMN_NAME | NUMERIC_PRECISION | +-------------+-------------------+ | a | 7 | | b | 7 | +-------------+-------------------+ {noformat} Notice, the precision value for {{UNSIGNED}} is wrong. It should be {{8}} digits. |
The MEDIUMINT type has the following characteristics depending on signess:
{noformat} MEDIUMINT SIGNED -8388608..8388607 (7 digits, 8 characters) MEDIUNINT UNSIGNED 0..16777215 (8 digits, 8 characters) {noformat} But these characteristics are not taken into account precisely: {code:sql} 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'; {code} {noformat} +-------------+-------------------+ | COLUMN_NAME | NUMERIC_PRECISION | +-------------+-------------------+ | a | 7 | | b | 7 | +-------------+-------------------+ {noformat} Notice, the precision value for {{UNSIGNED}} is wrong. It should be {{8}} digits. |
Link |
This issue relates to |
issue.field.resolutiondate | 2018-04-20 14:16:34.0 | 2018-04-20 14:16:34.299 |
Fix Version/s | 10.3.7 [ 23005 ] | |
Fix Version/s | 10.3 [ 22126 ] | |
Resolution | Fixed [ 1 ] | |
Status | Open [ 1 ] | Closed [ 6 ] |
Workflow | MariaDB v3 [ 86642 ] | MariaDB v4 [ 154187 ] |