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.