Bug #107258 Remove version comments for deprecated versions
Submitted: 11 May 2022 7:47 Modified: 11 May 2022 8:41
Reporter: Shlomi Noach (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Information schema Severity:S3 (Non-critical)
Version:5.7+ OS:Any
Assigned to: CPU Architecture:Any
Tags: SQL, version comments

[11 May 2022 7:47] Shlomi Noach
Description:
A suggestion: remove version comments for versions that have reached End Of Life.

For example, consider this `SHOW CREATE TABLE` output on a MySQL 8.0 server:

```
> show create table quarterly_report_status\G
*************************** 1. row ***************************
       Table: quarterly_report_status
Create Table: CREATE TABLE `quarterly_report_status` (
  `report_id` int NOT NULL,
  `report_status` varchar(20) NOT NULL,
  `report_updated` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
/*!50100 PARTITION BY RANGE (unix_timestamp(`report_updated`))
(PARTITION p1 VALUES LESS THAN (1206997200) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (1214859600) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (1222808400) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (1230760800) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (1238533200) ENGINE = InnoDB) */
```

The output has a `/*!50100 ... */` version comment. But MySQL version `5.0` has reached EOL many years ago, well before my MySQL 8.0 version was created.

While there's nothing wrong here, it's cleaner and nicer to get rid of version comments that are not strictly required.

How to repeat:
Partitioned tables are just an example. Any SHOW command that produces a version comment, including in sqldump, is affected.

Suggested fix:
The output should be:

> show create table quarterly_report_status\G
*************************** 1. row ***************************
       Table: quarterly_report_status
Create Table: CREATE TABLE `quarterly_report_status` (
  `report_id` int NOT NULL,
  `report_status` varchar(20) NOT NULL,
  `report_updated` timestamp NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
PARTITION BY RANGE (unix_timestamp(`report_updated`))
(PARTITION p1 VALUES LESS THAN (1206997200) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (1214859600) ENGINE = InnoDB,
 PARTITION p3 VALUES LESS THAN (1222808400) ENGINE = InnoDB,
 PARTITION p4 VALUES LESS THAN (1230760800) ENGINE = InnoDB,
 PARTITION p5 VALUES LESS THAN (1238533200) ENGINE = InnoDB)
```
[11 May 2022 8:41] MySQL Verification Team
Hello Shlomi,

Thank you for the report and feedback.

regards,
Umesh