DatabaseMetaData.getImportedKeys() throws exception in JDBC driver

DatabaseMetaData.getImportedKeys() throws exception in JDBC driver

am 30.08.2002 18:42:21 von Ken Hausam

Sorry, I didn't see a mailing list for MySQL-Connector-Java yet,
although this problem isn't necessarily just with the JDBC driver.

Database OS: Linux
MySQL-Max: 3.23.51
JDBC driver: mysql-connector-java-2.0.14 running on XP.
JVM: 1.3

When I execute the following SQL:

show table status from mswurld1 like 'AFF';

I get back the following in the comment column:

InnoDB free: 379904 kB; (AFF_STAT_ID) REFER
mswurld1/AFF_STAT(AFF_STAT_ID); (CMSN_CPY_ID) REFER
mswurld1/CMSN_CPY(CMSN_CPY_ID); (PAY_PROC_CPY_ID) REFER
mswurld1/PAY_PROC_CPY(PAY_PROC_CPY_ID); (CPY_ID) REFER
mswurld1/CPY(CPY_ID); (AFF_STAT_RSN_ID) REFER
mswurld1/AFF_STAT_RSN(AFF_STAT_RSN_ID); (BILL_PERIOD_ID) REFER
mswurld1/BILL_PERIOD(BILL_PERIOD_ID); (CMSN_CPY_ID) REFER
mswurld1/CMSN_CPY(CMSN_CPY_ID); (PAY_PROC_CPY_ID) REFER
mswurld1/PAY_PROC_CPY(PAY_PROC_CPY_ID); (

Not sure why I'm getting that last open parenthesis. As the JDBC code is
currently written, it causes the following exception:

java.util.NoSuchElementException
at
java.util.StringTokenizer.nextToken(StringTokenizer.java:235 )
at
com.mysql.jdbc.DatabaseMetaData.getImportedKeys(DatabaseMeta Data.java:32
47)
at
com.wurldmedia.generator.GeneratorDBHelper.getForeignKeys(Ge neratorDBHel
per.java:231)

The exception is thrown when the code tries to parse tokens out of the
keys variable with value of "(".

The SQL used to generate the foreign keys is:

ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (CMSN_CPY_ID)
REFERENCES CMSN_CPY(CMSN_CPY_ID);=20
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (PAY_PROC_CPY_ID)
REFERENCES PAY_PROC_CPY(PAY_PROC_CPY_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (CPY_ID)
REFERENCES CPY(CPY_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (AFF_STAT_RSN_ID)
REFERENCES AFF_STAT_RSN(AFF_STAT_RSN_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (BILL_PERIOD_ID)
REFERENCES BILL_PERIOD(BILL_PERIOD_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (APPROVAL_USER_ID)
REFERENCES WUSER(USER_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (AFF_STAT_ID)
REFERENCES AFF_STAT(AFF_STAT_ID);


The APPROVAL_USER_ID constraint is missing from the comments data. Is
there a limit on the size of the comments column? That would explain why
I'm seeing the trailing parenthesis and getting an exception in the JDBC
driver.

How-To-Repeat:
1. Create an InnoDB table with a large number of foreign key
constraints.
2. Execute a "SHOW TABLE STATUS' for that table and examine the data in
the coments column.


Ken Hausam
Wurld Media, Inc
Phone: 518-691-1100
Fax: 518-691-1170
=20

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12452@lists.mysql.com
To unsubscribe, e-mail

RE: DatabaseMetaData.getImportedKeys() throws exception in JDBC driver

am 03.09.2002 15:35:07 von Ken Hausam

Here's the offending source code line: (line 3302 of ha_innobase.cpp in
the windows src distribution of version 3.23.52)

/* We assume 450 - length bytes of space to print info */

if (length < 450) {
dict_print_info_on_foreign_keys(FALSE, pos, 450 -
length,
=09
prebuilt->table);
}


Anyone know why 450 was chosen as the magic number here? There's no
comment explaining this constant choice.


-----Original Message-----
From: Ken Hausam=20
Sent: Friday, August 30, 2002 12:42 PM
To: 'bugs@lists.mysql.com'
Subject: DatabaseMetaData.getImportedKeys() throws exception in JDBC
driver


Sorry, I didn't see a mailing list for MySQL-Connector-Java yet,
although this problem isn't necessarily just with the JDBC driver.

Database OS: Linux
MySQL-Max: 3.23.51
JDBC driver: mysql-connector-java-2.0.14 running on XP.
JVM: 1.3

When I execute the following SQL:

show table status from mswurld1 like 'AFF';

I get back the following in the comment column:

InnoDB free: 379904 kB; (AFF_STAT_ID) REFER
mswurld1/AFF_STAT(AFF_STAT_ID); (CMSN_CPY_ID) REFER
mswurld1/CMSN_CPY(CMSN_CPY_ID); (PAY_PROC_CPY_ID) REFER
mswurld1/PAY_PROC_CPY(PAY_PROC_CPY_ID); (CPY_ID) REFER
mswurld1/CPY(CPY_ID); (AFF_STAT_RSN_ID) REFER
mswurld1/AFF_STAT_RSN(AFF_STAT_RSN_ID); (BILL_PERIOD_ID) REFER
mswurld1/BILL_PERIOD(BILL_PERIOD_ID); (CMSN_CPY_ID) REFER
mswurld1/CMSN_CPY(CMSN_CPY_ID); (PAY_PROC_CPY_ID) REFER
mswurld1/PAY_PROC_CPY(PAY_PROC_CPY_ID); (

Not sure why I'm getting that last open parenthesis. As the JDBC code is
currently written, it causes the following exception:

java.util.NoSuchElementException
at
java.util.StringTokenizer.nextToken(StringTokenizer.java:235 )
at
com.mysql.jdbc.DatabaseMetaData.getImportedKeys(DatabaseMeta Data.java:32
47)
at
com.wurldmedia.generator.GeneratorDBHelper.getForeignKeys(Ge neratorDBHel
per.java:231)

The exception is thrown when the code tries to parse tokens out of the
keys variable with value of "(".

The SQL used to generate the foreign keys is:

ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (CMSN_CPY_ID)
REFERENCES CMSN_CPY(CMSN_CPY_ID);=20
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (PAY_PROC_CPY_ID)
REFERENCES PAY_PROC_CPY(PAY_PROC_CPY_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (CPY_ID)
REFERENCES CPY(CPY_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (AFF_STAT_RSN_ID)
REFERENCES AFF_STAT_RSN(AFF_STAT_RSN_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (BILL_PERIOD_ID)
REFERENCES BILL_PERIOD(BILL_PERIOD_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (APPROVAL_USER_ID)
REFERENCES WUSER(USER_ID);
ALTER TABLE AFF
ADD CONSTRAINT FOREIGN KEY (AFF_STAT_ID)
REFERENCES AFF_STAT(AFF_STAT_ID);


The APPROVAL_USER_ID constraint is missing from the comments data. Is
there a limit on the size of the comments column? That would explain why
I'm seeing the trailing parenthesis and getting an exception in the JDBC
driver.

How-To-Repeat:
1. Create an InnoDB table with a large number of foreign key
constraints. 2. Execute a "SHOW TABLE STATUS' for that table and examine
the data in the coments column.


Ken Hausam
Wurld Media, Inc
Phone: 518-691-1100
Fax: 518-691-1170
=20

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12478@lists.mysql.com
To unsubscribe, e-mail