Description:
Looking at the example present in the manual - https://dev.mysql.com/doc/mysql-infoschema-excerpt/8.0/en/information-schema-innodb-temp-t...
which is easier to reproduce as well.
We create an external temp table with a valid name yet when querying the
I_S.INNODB_TEMP_TABLE_INFO, it's correct name is not visible but the adhoc name like internal temp tables is visible. This is misleading and IMHO a bug that should be fixed.
How to repeat:
> create temporary table t1(id int);
Query OK, 0 rows affected (0.181 sec)
> select * from information_schema.INNODB_TEMP_TABLE_INFO;
+----------+--------------+--------+------------+
| TABLE_ID | NAME | N_COLS | SPACE |
+----------+--------------+--------+------------+
| 1095 | #sqlbae4_8_3 | 4 | 4243767290 |
+----------+--------------+--------+------------+
1 row in set (0.001 sec)
The name field should be 't1' then '#sqlbae4_8_3'. It shouldn't matter if there exists another regular table with the same name because we both tables can co-exists and we querying the table for temp tables only.
Suggested fix:
See previous section.