Bug #41694 Foreign keys: poor transition from old InnoDB tables
Submitted: 23 Dec 2008 0:26 Modified: 20 Dec 2013 6:53
Reporter: Peter Gulutzan Email Updates:
Status: Won't fix Impact on me:
None 
Category:MySQL Server: General Severity:S3 (Non-critical)
Version:6.1.0-alpha-debug OS:Linux (SUSE 10.0 / 32-bit)
Assigned to: CPU Architecture:Any

[23 Dec 2008 0:26] Peter Gulutzan
Description:
I'm using mysql-6.1-fk.
I start the server with mysqld --foreign-key-all-engines=1.

Originally I had created some InnoDB tables with --foreign-key-all-engines=0.
When I try to access these tables in any way, I get error messages.

How to repeat:
Start mysqld without --foreign-key-all-engines=1.

Start client.

create table t1 (s1 int primary key) engine=innodb;
create table t2 (s1 int, foreign key (s1) references t1(s1)) engine=innodb;

Stop mysqld.
Start mysqld with --foreign-key-all-engines=1.

Start client.

You'll notice a message on the mysqld console when you 'use' the database:
"081222 11:26:15 [ERROR] Attempt to open InnoDB table 'test/t2' which has 'native' foreign keys defined while running in --foreign-key-all-engines mode."

select * from t1;

You'll notice an error message:

ERROR 1112 (42000): Table 't1' uses an extension that doesn't exist in this MySQL version

Since t1 is not a foreign-key table, this might be irritating.
[23 Dec 2008 14:18] MySQL Verification Team
Thank you for the bug report. Verified as described:

Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 6.1.0-alpha-debug Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> select * from t1;
ERROR 1112 (42000): Table 't1' uses an extension that doesn't exist in this MySQL version
mysql>
[20 Dec 2013 6:53] Erlend Dahl
6.x project was abandoned years ago.