Description:
If an FTS primary table is assigned to a general tablespace, FTS auxiliary tables should also be created in the same tablespace.
This should work even if the primary table is compressed unless there is a good reason to never compress FTS auxiliary tables.
How to repeat:
mysql> CREATE TABLE t1 (a VARCHAR(200), b TEXT, FULLTEXT (a,b)) ENGINE = InnoDB TABLESPACE=s1;
Query OK, 0 rows affected (2 min 45.08 sec)
mysql> SELECT * FROM information_schema.INNODB_SYS_TABLES where name like 'test%';
+----------+----------------------------------------------------+------+--------+-------+-------------+------------+---------------+------------+
| TABLE_ID | NAME | FLAG | N_COLS | SPACE | FILE_FORMAT | ROW_FORMAT | ZIP_PAGE_SIZE | SPACE_TYPE |
+----------+----------------------------------------------------+------+--------+-------+-------------+------------+---------------+------------+
| 147 | test/FTS_000000000000008d_00000000000000cf_INDEX_1 | 1 | 8 | 0 | Antelope | Compact | 0 | System |
| 148 | test/FTS_000000000000008d_00000000000000cf_INDEX_2 | 1 | 8 | 0 | Antelope | Compact | 0 | System |
| 149 | test/FTS_000000000000008d_00000000000000cf_INDEX_3 | 1 | 8 | 0 | Antelope | Compact | 0 | System |
| 150 | test/FTS_000000000000008d_00000000000000cf_INDEX_4 | 1 | 8 | 0 | Antelope | Compact | 0 | System |
| 151 | test/FTS_000000000000008d_00000000000000cf_INDEX_5 | 1 | 8 | 0 | Antelope | Compact | 0 | System |
| 152 | test/FTS_000000000000008d_00000000000000cf_INDEX_6 | 1 | 8 | 0 | Antelope | Compact | 0 | System |
| 144 | test/FTS_000000000000008d_BEING_DELETED | 1 | 4 | 89 | Antelope | Compact | 0 | Single |
| 145 | test/FTS_000000000000008d_BEING_DELETED_CACHE | 1 | 4 | 90 | Antelope | Compact | 0 | Single |
| 146 | test/FTS_000000000000008d_CONFIG | 1 | 5 | 91 | Antelope | Compact | 0 | Single |
| 142 | test/FTS_000000000000008d_DELETED | 1 | 4 | 87 | Antelope | Compact | 0 | Single |
| 143 | test/FTS_000000000000008d_DELETED_CACHE | 1 | 4 | 88 | Antelope | Compact | 0 | Single |
| 141 | test/t1 | 129 | 6 | 76 | Antelope | Compact | 0 | General |
+----------+----------------------------------------------------+------+--------+-------+-------------+------------+---------------+------------+
12 rows in set (0.01 sec)
Suggested fix:
FTS auxiliary index tables are created in ts_create_one_index_table() which does not apply the HAS_SHARED_SPACE flag in its call to dict_mem_table_create(). When it does this, care should be taken so that this code will work with a compressed FTS primary table.
FTS auxiliary common tables use the internal SQL parser which does not support the tablespace phrase. There is a plan to bypass and decommision the InnoDB internal SQL parser in the future. So the proper way to get the FTS common table tablespace aware is to make them use row_create_table_for_mysql() in similare way as the FTS index tables are created..