Bug #42746 CREATE fails when the table creates a foreign key, referencing to some table.
Submitted: 11 Feb 2009 6:01 Modified: 21 Feb 2014 19:35
Reporter: Nirbhay Choubey Email Updates:
Status: Unsupported Impact on me:
None 
Category:Obsolete Severity:S3 (Non-critical)
Version:5.1.30 OS:Other (IBM i 5.4)
Assigned to: CPU Architecture:Any

[11 Feb 2009 6:01] Nirbhay Choubey
Description:
CREATE TABLE fails when the table creates a foreign key, referencing to some other table with ibmdb2i storage engine.

mysql> create database test;
Query OK, 1 row affected (0.01 sec)

mysql> use test;
Database changed
mysql> create table t1(a varchar(10))engine=ibmdb2i;
Query OK, 0 rows affected (1.53 sec)

mysql> create table t2 (a varchar(10), foreign key (a) references t1(a))engine=ibmdb2i;
ERROR 1005 (HY000): Can't create table 'test.t2' (errno: 2021)

Server log : ibmdb2i error 2021: See message SQL0538 in joblog for job 307871/QUSER/QSQSRVR.

Job log :   Job 307871/QUSER/QSQSRVR started on 02/09/09 at 01:46:29 in subsystem
            QSYSWRK in QSYS. Job entered system on 02/09/09 at 01:46:29.
            ACGDTA for 307871/QUSER/QSQSRVR not journaled; reason 1.
            Printer device PRT01 not found.
            Errors on CHGJOB command for job 307871/QUSER/QSQSRVR.

How to repeat:
See the above description.

Suggested fix:
See the above description.
[21 Feb 2014 19:35] Sveta Smirnova
Thank you for the report.

Storage engine ibmdb2i is not supported anymore.