Bug #5187 DISABLE/ENABLE KEYS causes warning with InnoDB
Submitted: 24 Aug 2004 18:14 Modified: 24 Aug 2004 20:13
Reporter: Rob Blick Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:4.1.3 beta OS:Linux (Redhat 9)
Assigned to: CPU Architecture:Any

[24 Aug 2004 18:14] Rob Blick
Description:
Using /*!40000 ALTER TABLE `tablename` DISABLE KEYS */; or /*!40000 ALTER TABLE `tab` ENABLE KEYS */; causes a warning with InnoDB ("code 1031 - Table storage engine for 'tab' doesn't have this option").  I'm not sure if it's a bug or is to be expected but isn't documented.

How to repeat:
CREATE TABLE tab (a integer) ENGINE=InnoDB;

mysqldump the table.  The .sql script will contain:

/*!40000 ALTER TABLE `tab` DISABLE KEYS */;
and
/*!40000 ALTER TABLE `tab` ENABLE KEYS */;

When executing the script, you'll get:
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+-------+------+---------------------------------------------------------+
| Level | Code | Message                                                 |
+-------+------+---------------------------------------------------------+
| Note  | 1031 | Table storage engine for 'tab' doesn't have this option |
+-------+------+---------------------------------------------------------+
1 row in set (0.00 sec)

Suggested fix:
If not a bug, simply add to documentation somewhere (maybe with ALTER TABLE).
[24 Aug 2004 20:13] Paul DuBois
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

Additional info:

It can't be a bug if the storage engine goes to the
trouble to tell you that it's ignoring the operation. :-)

I'll add a note to the ALTER TABLE section.