Bug #18258 DatabaseMetaData.getTables() or getColumns() for bad catalog throws exception

Submitted: 15 Mar 2006 16:51 Modified: 18 Oct 2006 21:37
Reporter: Frank Griffin Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version:3.1.12 OS:Linux (Linux)
Assigned to: CPU Architecture:Any

[15 Mar 2006 16:51] Frank Griffin
Description:
We have a MySQL server instance with a database CIA and a table COUNTRY.  If I issue the call
   getTables( "CIA", "%", "%",null)
I get a ResultSet with one row of catalog CIA schema null table COUNTRY, as expected.  If I issue the call
   getTables( "FOO", "%", "%",null)
I get the following in LogWriter:

**********
DriverManager.getConnection("jdbc:mysql://ftg.selectbs.com:3306/CIA")
    trying driver[className=oracle.jdbc.driver.OracleDriver,oracle.jdbc.driver.OracleDriver@14ed9ff]
    trying driver[className=com.mysql.jdbc.Driver,com.mysql.jdbc.Driver@12b3374]getConnection returning driver[className=com.mysql.jdbc.Driver,com.mysql.jdbc.Driver@12b3374]
SQLException: SQLState(HY000) vendor code(12)
java.sql.SQLException: Can't read dir of './FOO/' (Errcode: 2)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2928)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:771)
        at com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1289)
        at com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:2261)
        at com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:423)
        at com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:1962)        at com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:1385)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1728)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2988)
        at com.mysql.jdbc.Connection.execSQL(Connection.java:2917)
        at com.mysql.jdbc.Statement.executeQuery(Statement.java:824)
        at com.mysql.jdbc.DatabaseMetaData$9.forEach(DatabaseMetaData.java:4447)        at com.mysql.jdbc.DatabaseMetaData$IterateBlock.doForAll(DatabaseMetaData.java:79)
        at com.mysql.jdbc.DatabaseMetaData.getTables(DatabaseMetaData.java:4440)        at com.mysql.jdbc.DatabaseMetaData$2.forEach(DatabaseMetaData.java:1928)        at com.mysql.jdbc.DatabaseMetaData$IterateBlock.doForAll(DatabaseMetaData.java:79)
        at com.mysql.jdbc.DatabaseMetaData.getColumns(DatabaseMetaData.java:1894)
        at com.selectbs.NOMAD.jdbc.NOMADJDBCCore.functionDescribe(NOMADJDBCCore.java:1110)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.selectbs.NOMAD.jdbc.NOMADJDBCCore.run(NOMADJDBCCore.java:481)
        at com.selectbs.NOMAD.jdbc.NOMADJDBCTest.main(NOMADJDBCTest.java:152)
**********

I would expect to simply see an empty result set.

The same exception is thrown for getColumns() wit the same parameters.  In fact the above stacktrace came from a getColumns() call.

How to repeat:
Reproducible case given in description.

Suggested fix:
None.
[4 May 2006 21:26] Tonci Grgin
Hi Frank. Thanks for your bug report. Verified as described by reporter both on 3.1.12 and 5.0.0.0
[4 May 2006 21:38] Frank Griffin
My pleasure.  Thanks for a great product !
[10 Oct 2006 14:59] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/13414
[18 Oct 2006 21:37] Mark Matthews
Fixed in 3.1.14.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.054 sec. using MySQL 8.4.7-u6-cloud

Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.