COMMENTを含むとThe table parameter '***' is invalid`というエラーが発生します。
parser指定以外の場合には、無視するようにして頂きたいです。
$ mysql -uroot
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 15
Server version: 5.6.11-log MySQL Community Server (GPL)
Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use test;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> CREATE TABLE hoge_table (
-> id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'PK',
-> contents TEXT COMMENT 'contents',
-> FULLTEXT INDEX (contents)
-> ) ENGINE = mroonga DEFAULT CHARSET utf8;
ERROR 16501 (HY000): The table parameter 'PK' is invalid
mysql> CREATE TABLE hoge_table2 (
-> id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'PK',
-> contents TEXT COMMENT 'コンテンツ',
-> FULLTEXT INDEX (contents)
-> ) ENGINE = mroonga DEFAULT CHARSET utf8;
ERROR 16501 (HY000): The table parameter 'コンテンツ' is invalid
mysql> CREATE TABLE hoge_table3 (
-> id INT PRIMARY KEY AUTO_INCREMENT COMMENT 'プライマリキー',
-> contents TEXT COMMENT 'コンテンツ',
-> FULLTEXT INDEX (contents)
-> ) ENGINE = mroonga DEFAULT CHARSET utf8;
ERROR 16501 (HY000): The table parameter 'プライマリキー' is invalid
mysql> CREATE TABLE hoge_table4 (
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> contents TEXT,
-> FULLTEXT INDEX (contents)
-> ) ENGINE = mroonga DEFAULT CHARSET utf8;
Query OK, 0 rows affected (0.01 sec)
また、ALTER TABLE構文でCOMMENTを付与するとテーブルが壊れます。
mysql> CREATE TABLE table_with_comment (
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> contents TEXT ,
-> FULLTEXT INDEX (contents)
-> ) ENGINE = mroonga DEFAULT CHARSET utf8;
Query OK, 0 rows affected (0.01 sec)
mysql> ALTER TABLE table_with_comment CHANGE contents contents TEXT COMMENT 'foo';
ERROR 16501 (HY000): The table parameter 'foo' is invalid
mysql> show table status \G
*************************** 1. row ***************************
Name: table_with_comment
Engine: NULL
Version: NULL
Row_format: NULL
Rows: NULL
Avg_row_length: NULL
Data_length: NULL
Max_data_length: NULL
Index_length: NULL
Data_free: NULL
Auto_increment: NULL
Create_time: NULL
Update_time: NULL
Check_time: NULL
Collation: NULL
Checksum: NULL
Create_options: NULL
Comment: The table parameter 'foo' is invalid
1 row in set, 1 warning (0.00 sec)
mysql> show create table table_with_comment;
ERROR 16501 (HY000): The table parameter 'foo' is invalid
mysql> drop table table_with_comment;
ERROR 16501 (HY000): The table parameter 'foo' is invalid
InnoDB Wrapperモードの場合には、ALTER TABLE構文でCOMMENTを付与するとテーブルが壊れるだけでなく、
手動削除後に同じ名前のテーブルが作成できなくなります。(ibdabta1に管理データがあるため)
mysql> CREATE TABLE table_with_comment_innodb (
-> id INT PRIMARY KEY AUTO_INCREMENT,
-> contents TEXT ,
-> FULLTEXT INDEX (contents)
-> ) ENGINE = mroonga DEFAULT CHARSET utf8 COMMENT = 'engine "innodb"' ;
Query OK, 0 rows affected (0.01 sec)
mysql> ALTER TABLE table_with_comment_innodb CHANGE contents contents TEXT COMMENT 'foo';
ERROR 16501 (HY000): The table parameter 'foo' is invalid
mysql> show table status \G
*************************** 1. row ***************************
Name: table_with_comment_innodb
Engine: NULL
Version: NULL
Row_format: NULL
Rows: NULL
Avg_row_length: NULL
Data_length: NULL
Max_data_length: NULL
Index_length: NULL
Data_free: NULL
Auto_increment: NULL
Create_time: NULL
Update_time: NULL
Check_time: NULL
Collation: NULL
Checksum: NULL
Create_options: NULL
Comment: The table parameter 'foo' is invalid
1 row in set, 1 warning (0.00 sec)
mysql> show table status \G
Empty set (0.00 sec)
$ sudo rm /var/lib/mysql/test/table_with_comment_innodb.*
rm: remove regular file `/var/lib/mysql/test/table_with_comment_innodb.frm'? y
rm: remove regular file `/var/lib/mysql/test/table_with_comment_innodb.ibd'? y
$ sudo rm /var/lib/mysql/test.mrn.00001*
rm: remove regular file `/var/lib/mysql/test.mrn.0000109'? y
rm: remove regular file `/var/lib/mysql/test.mrn.0000113'? y
rm: remove regular file `/var/lib/mysql/test.mrn.0000117'? y
rm: remove regular file `/var/lib/mysql/test.mrn.0000117.c'? y
mysql> show table status \G
Empty set (0.00 sec)
mysql> CREATE TABLE table_with_comment_innodb ( id INT PRIMARY KEY AUTO_INCREMENT, contents TEXT , FULLTEXT INDEX (contents) ) ENGINE = mroonga DEFAULT CHARSET utf8 COMMENT = 'engine "innodb"';
ERROR 16501 (HY000): The table parameter 'foo' is invalid
mysql> show table status;
Empty set (0.00 sec)
$ sudo /etc/init.d/mysql restart
Shutting down MySQL.. [ OK ]
Starting MySQL. [ OK ]
mysql> CREATE TABLE table_with_comment_innodb ( id INT PRIMARY KEY AUTO_INCREMENT, contents TEXT , FULLTEXT INDEX (contents) ) ENGINE = mroonga DEFAULT CHARSET utf8 COMMENT = 'engine "innodb"';
ERROR 1050 (42S01): Table '`test`.`table_with_comment_innodb`' already exists
mysql> show table status; Empty set (0.00 sec)
mysql> drop table table_with_comment_innodb;
ERROR 1051 (42S02): Unknown table 'test.table_with_comment_innodb'