Description:
The UDOFILE entries from a logfile group show up in the information_schema.FILES with a not null value for TABLESPACE_NAME, even when there are multiple tablespaces that use the logfile group
How to repeat:
create logfile group logfilegroup1 add undofile '/opt/mysql/cluster/logfilegroup1_undofile1.dat' initial_size 10M undo_buffer_size 5M engine ndb;
mysql> create tablespace tablespace1 add datafile '/opt/mysql/cluster/tablespace1_datafile1.dat' use logfile group logfilegroup1 extent_size 1024 initial_size 10M engine = ndb;
Query OK, 0 rows affected (1.05 sec)
mysql> select file_name, tablespace_name, table_name, logfile_group_name, extent_size, initial_size, maximum_size, data_free, extra from information_schema.files;
+------------------------------------------------+-----------------+------------+--------------------+-------------+--------------+--------------+-----------+----------------+
| file_name | tablespace_name | table_name | logfile_group_name | extent_size | initial_size | maximum_size | data_free | extra |
+------------------------------------------------+-----------------+------------+--------------------+-------------+--------------+--------------+-----------+----------------+
| /opt/mysql/cluster/tablespace1_datafile1.dat | tablespace1 | | logfilegroup1 | 1024 | 10485760 | 10485760 | NULL | CLUSTER_NODE=2 |
| /opt/mysql/cluster/tablespace1_datafile1.dat | tablespace1 | | logfilegroup1 | 1024 | 10485760 | 10485760 | NULL | CLUSTER_NODE=3 |
| /opt/mysql/cluster/logfilegroup1_undofile1.dat | tablespace1 | | logfilegroup1 | 4 | 10485760 | 10485760 | NULL | CLUSTER_NODE=2 |
| /opt/mysql/cluster/logfilegroup1_undofile1.dat | tablespace1 | | logfilegroup1 | 4 | 10485760 | 10485760 | NULL | CLUSTER_NODE=3 |
+------------------------------------------------+-----------------+------------+--------------------+-------------+--------------+--------------+-----------+----------------+
4 rows in set (0.00 sec)
create tablespace tablespace2 add datafile '/opt/mysql/cluster/tablespace2_datafile1.dat' use logfile group logfilegroup1 extent_size 1024 initial_size 10M engine = ndb;
mysql> select file_name, tablespace_name, table_name, logfile_group_name, extent_size, initial_size, maximum_size, data_free, extra from information_schema.files;
+------------------------------------------------+-----------------+------------+--------------------+-------------+--------------+--------------+-----------+----------------+
| file_name | tablespace_name | table_name | logfile_group_name | extent_size | initial_size | maximum_size | data_free | extra |
+------------------------------------------------+-----------------+------------+--------------------+-------------+--------------+--------------+-----------+----------------+
| /opt/mysql/cluster/tablespace1_datafile1.dat | tablespace1 | | logfilegroup1 | 1024 | 10485760 | 10485760 | NULL | CLUSTER_NODE=2 |
| /opt/mysql/cluster/tablespace1_datafile1.dat | tablespace1 | | logfilegroup1 | 1024 | 10485760 | 10485760 | NULL | CLUSTER_NODE=3 |
| /opt/mysql/cluster/tablespace2_datafile1.dat | tablespace2 | | logfilegroup1 | 1024 | 10485760 | 10485760 | NULL | CLUSTER_NODE=2 |
| /opt/mysql/cluster/tablespace2_datafile1.dat | tablespace2 | | logfilegroup1 | 1024 | 10485760 | 10485760 | NULL | CLUSTER_NODE=3 |
| /opt/mysql/cluster/logfilegroup1_undofile1.dat | tablespace2 | | logfilegroup1 | 4 | 10485760 | 10485760 | NULL | CLUSTER_NODE=2 |
| /opt/mysql/cluster/logfilegroup1_undofile1.dat | tablespace2 | | logfilegroup1 | 4 | 10485760 | 10485760 | NULL | CLUSTER_NODE=3 |
Suggested fix:
I think the TABLESPACE_NAME should always be NULL for UNDOFILE entries - UNDOFILE's are not related directly to tablespaces.