Bug #95751 information_schema.INNODB_TABLESPACES show wrong table name
Submitted: 12 Jun 2019 11:21 Modified: 12 Jun 2019 12:48
Reporter: yuhui wang Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.16 OS:Any
Assigned to: CPU Architecture:Any
Tags: INNODB_TABLESPACES, partition table

[12 Jun 2019 11:21] yuhui wang
Description:
Partition table's name is wrong in the 'NAME' column of information_schema.INNODB_TABLES. 

How to repeat:
CREATE TABLE `members` (
  `id` int(11) DEFAULT NULL,
  `fname` varchar(25) DEFAULT NULL,
  `lname` varchar(25) DEFAULT NULL,
  `dob` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8
 PARTITION BY RANGE (year(`dob`))
(PARTITION p0 VALUES LESS THAN (1970) ENGINE = InnoDB,
 PARTITION p1 VALUES LESS THAN (1980) ENGINE = InnoDB,
 PARTITION p2 VALUES LESS THAN (1990) ENGINE = InnoDB);

mysql>  select NAME from information_schema.INNODB_TABLESPACES where name like '%members%';;
+-------------------+
| NAME              |
+-------------------+
| test/members?p?p0 |
| test/members?p?p1 |
| test/members?p?p2 |
+-------------------+
3 rows in set (0.00 sec)

The character '?' should be replace with '#'

If we query innodb_tables, it is ok.

mysql>  select NAME from information_schema.INNODB_TABLES where name like '%members%';
+-------------------+
| NAME              |
+-------------------+
| test/members#p#p0 |
| test/members#p#p1 |
| test/members#p#p2 |
+-------------------+
3 rows in set (0.00 sec)
[12 Jun 2019 12:48] MySQL Verification Team
Hi Mr. Wang,

Thank you for your bug report.

However, this is not a bug. Instead of the queries that you have used, you should have used a query like this one:

SELECT PARTITION_NAME FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'members';

NAME is a column name for the entire table, while each partition has its own name.

I_S and InnoDB SE use different delimiters to present table name, but that is irrelevant, because table name is NOT a partition name, as I explained above.

Not a bug.