Not the answer you need?
Register and ask your own question!

mysqldump with --innodb-optimize-keys causes un-restorable dumps in some conditions

systems28347systems28347 EntrantInactive User Role Beginner
I've found a bug in '--innodb-optimize-keys', which causes dumps not to be able to be restored.

This is related to the FK constraints, whom FOREGIN_KEY_CHECKS=0 does not cause to be ignored under certain circumstances:
SET FOREIGN_KEY_CHECKS = 0;

# Doesn't fail, as expected
# CREATE TABLE a( val INT, FOREIGN KEY testfk ( val ) REFERENCES b( val ) );

# Fails, unexpectedly (on the first statement)
# CREATE TABLE b( val INT );
ALTER TABLE b ADD INDEX( val );

This is the typical structure of a dump created with --innodb-optimize-keys.
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.