[MDEV-8267] Add /*old*/ comment into I_S.COLUMN_TYPE for old DECIMAL Created: 2015-06-04  Updated: 2018-05-30  Resolved: 2015-06-04

Status: Closed
Project: MariaDB Server
Component/s: OTHER
Affects Version/s: 5.5, 10.0, 10.1
Fix Version/s: 5.5.44

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

Issue Links:
Blocks
blocks MDEV-7628 Row-based replication of old DECIMAL ... Stalled

 Description   

Currently there is no an easy way to distinguish between an old DECIMAL data type the new DECIMAL which was introduced in 5.5

The old column type is not automatically converted to the new data type on upgrade because of some incompatibility in the supported precision and scale ranges.

Some users still have old DECIMAL in their 10.0 installations after a set upgrades made in different years (to 5.0, 5.1, 5.5 and finally to 10.0) and even don't know about presence of such column!

We will add the "/*old*/" comment into the column type.

  • In INFORMATION_SCHEMA:

    MariaDB [test]> SELECT DATA_TYPE, COLUMN_TYPE FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME='a';
    +-----------+----------------------+
    | DATA_TYPE | COLUMN_TYPE          |
    +-----------+----------------------+
    | decimal   | decimal(10,2)/*old*/ |
    +-----------+----------------------+

  • In SHOW COLUMNS:

    MariaDB [test]> SHOW COLUMNS FROM dec102;
    +-------+----------------------+------+-----+---------+-------+
    | Field | Type                 | Null | Key | Default | Extra |
    +-------+----------------------+------+-----+---------+-------+
    | a     | decimal(10,2)/*old*/ | YES  |     | NULL    |       |
    +-------+----------------------+------+-----+---------+-------+

  • SHOW CREATE TABLE

    MariaDB [test]> SHOW CREATE TABLE dec102;
    +--------+--------------------------------------------------------------------------------------------------------+
    | Table  | Create Table                                                                                           |
    +--------+--------------------------------------------------------------------------------------------------------+
    | dec102 | CREATE TABLE `dec102` (
      `a` decimal(10,2)/*old*/ DEFAULT NULL
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 |
    +--------+--------------------------------------------------------------------------------------------------------+


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