Bug #43714 useInformationSchema with DatabaseMetaData.getExportedKeys() throws exception
Submitted: 17 Mar 21:34 Modified: 23 Jun 15:02
Reporter: Jess Balint
Status: Closed
Category:Connector/J Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: Bugs System Target Version:

[17 Mar 21:34] Jess Balint
Description:
useInformationSchema with DatabaseMetaData.getExportedKeys() throws exception

com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column
'REFERENCED_TABLE_NAME' in where clause is ambiguous
...
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1772)
	at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1923)
	at
com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema.executeMetadataQuery(DatabaseMetaDataUsingInfoSchema.java:50)
	at
com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema.getExportedKeys(DatabaseMetaDataUsingInfoSchema.java:603)

How to repeat:
see above
[17 Mar 22:16] Jess Balint
fix + test

Attachment: bug43714.diff (text/x-diff), 1.91 KiB.

[17 Mar 22:16] Jess Balint
Only against MySQL 5.1
[2 Jun 7:59] Jess Balint
Pushed for release in 5.1.8
[23 Jun 15:02] Tony Bedford
An entry was added to the 5.1.8 changelog:

Using useInformationSchema with DatabaseMetaData.getExportedKeys() generated the
following exception:

com.mysql.jdbc.exceptions.MySQLIntegrityConstraintViolationException: Column
'REFERENCED_TABLE_NAME' in where clause is ambiguous
...
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1772)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1923)
at
com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema.executeMetadataQuery(
DatabaseMetaDataUsingInfoSchema.java:50)
at
com.mysql.jdbc.DatabaseMetaDataUsingInfoSchema.getExportedKeys(
DatabaseMetaDataUsingInfoSchema.java:603)