Bug #75451 Cannot use a table containing special chars for InnoDB stopwords
Submitted: 8 Jan 2015 17:58 Modified: 9 Jan 2015 6:31
Reporter: Federico Razzoli Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.6, 5.6.24, 5.7.6 OS:Any
Assigned to: CPU Architecture:Any
Tags: fulltext

[8 Jan 2015 17:58] Federico Razzoli
Description:
InnoDB stopwords cannot be stored in a table whose name contains special chars.

How to repeat:
This won't work:

CREATE TABLE `stop_it-IT` ENGINE = InnoDB
	SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';

This will work:

CREATE TABLE stop_it ENGINE = InnoDB
	SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
SET @@global.innodb_ft_server_stopword_table = 'test/stop_it';
[9 Jan 2015 6:31] MySQL Verification Team
Hello Federico Razzoli,

Thank you for the report.

Thanks,
Umesh
[9 Jan 2015 6:31] MySQL Verification Team
// 5.6.24

mysql> show variables like '%version%';
+-------------------------+---------------------------------------------------------+
| Variable_name           | Value                                                   |
+-------------------------+---------------------------------------------------------+
| innodb_version          | 5.6.24                                                  |
| protocol_version        | 10                                                      |
| slave_type_conversions  |                                                         |
| version                 | 5.6.24-enterprise-commercial-advanced                   |
| version_comment         | MySQL Enterprise Server - Advanced Edition (Commercial) |
| version_compile_machine | x86_64                                                  |
| version_compile_os      | linux-glibc2.5                                          |
+-------------------------+---------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> use test
Database changed
mysql> CREATE TABLE `stop_it-IT` ENGINE = InnoDB
    -> SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
Query OK, 36 rows affected (0.01 sec)
Records: 36  Duplicates: 0  Warnings: 0

mysql> SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';
ERROR 1231 (42000): Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/stop_it-IT'
mysql>
mysql> SET @@global.innodb_ft_server_stopword_table = `test/stop_it-IT`;
ERROR 1231 (42000): Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/stop_it-IT'
mysql>

mysql> SET @@global.innodb_ft_server_stopword_table = 'test/A';
ERROR 1231 (42000): Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/A'
mysql> show errors;
+-------+------+----------------------------------------------------------------------------------+
| Level | Code | Message                                                                          |
+-------+------+----------------------------------------------------------------------------------+
| Error | 1231 | Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/A' |
+-------+------+----------------------------------------------------------------------------------+
1 row in set (0.00 sec)

^^ Table doesn't exists but same error returns

// Works without special chars

mysql> CREATE TABLE stop_it ENGINE = InnoDB
    -> SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
Query OK, 36 rows affected (0.01 sec)
Records: 36  Duplicates: 0  Warnings: 0

mysql> SET @@global.innodb_ft_server_stopword_table = 'test/stop_it';
Query OK, 0 rows affected (0.00 sec)

mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| stop_it        |
| stop_it-IT     |
+----------------+
2 rows in set (0.00 sec)
[9 Jan 2015 6:32] MySQL Verification Team
// 5.7.6

mysql> show variables like '%version%';
+-------------------------+---------------------------------------------------------+
| Variable_name           | Value                                                   |
+-------------------------+---------------------------------------------------------+
| innodb_version          | 5.7.6                                                   |
| protocol_version        | 10                                                      |
| slave_type_conversions  |                                                         |
| version                 | 5.7.6-m16-enterprise-commercial-advanced                |
| version_comment         | MySQL Enterprise Server - Advanced Edition (Commercial) |
| version_compile_machine | x86_64                                                  |
| version_compile_os      | Linux                                                   |
+-------------------------+---------------------------------------------------------+
7 rows in set (0.00 sec)

mysql> CREATE TABLE `stop_it-IT` ENGINE = InnoDB
    -> SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
Query OK, 36 rows affected (0.00 sec)
Records: 36  Duplicates: 0  Warnings: 0

mysql> SET @@global.innodb_ft_server_stopword_table = 'test/stop_it-IT';
ERROR 1231 (42000): Variable 'innodb_ft_server_stopword_table' can't be set to the value of 'test/stop_it-IT'
mysql>
mysql> CREATE TABLE stop_it ENGINE = InnoDB
    -> SELECT * FROM information_schema.INNODB_FT_DEFAULT_STOPWORD;
Query OK, 36 rows affected (0.00 sec)
Records: 36  Duplicates: 0  Warnings: 0

mysql> SET @@global.innodb_ft_server_stopword_table = 'test/stop_it';
Query OK, 0 rows affected (0.00 sec)

mysql>
[18 Feb 2015 11:11] Jan Lindstrom
Possible fix candidate that allows real table name be used instead of technical path name. This patch is public domain.

Attachment: fix.diff (text/x-patch), 1.64 KiB.