bffmm1 / h2database

Automatically exported from code.google.com/p/h2database
0 stars 0 forks source link

JdbcDatabaseMetaData.getTables() references non-existent INFORMATION_SCHEMA.TABLES.TYPE_NAME #213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Before submitting a bug, please check the FAQ:
http://www.h2database.com/html/faq.html

What steps will reproduce the problem?
(simple SQL scripts or simple standalone applications are preferred)
1. Any call to JdbcDatabaseMetaData.getTables()

What is the expected output? What do you see instead?

Caused by: org.h2.jdbc.JdbcSQLException: Column TYPE_NAME not found; SQL 
statement:
SELECT TABLE_CATALOG TABLE_CAT, TABLE_SCHEMA TABLE_SCHEM, TABLE_NAME, 
TABLE_TYPE, REMARKS, TYPE_NAME TYPE_CAT, TYPE_NAME TYPE_SCHEM, TYPE_NAME, 
TYPE_NAME SELF_REFERENCING_COL_NAME, TYPE_NAME REF_GENERATION, SQL FROM 
INFORMATION_SCHEMA.TABLES WHERE TABLE_CATALOG LIKE ? ESCAPE '\' AND 
TABLE_SCHEMA LIKE ? ESCAPE '\' AND TABLE_NAME LIKE ? ESCAPE '\' AND (TABLE_TYPE 
IN(?)) ORDER BY TABLE_TYPE, TABLE_SCHEMA, TABLE_NAME [42122-112]
    at org.h2.message.Message.getSQLException(Message.java:107)
    at org.h2.message.Message.getSQLException(Message.java:118)
    at org.h2.message.Message.getSQLException(Message.java:77)
    at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:130)
    at org.h2.expression.Alias.optimize(Alias.java:49)
    at org.h2.command.dml.Select.prepare(Select.java:725)
    at org.h2.command.Parser.prepareCommand(Parser.java:233)
    at org.h2.engine.Session.prepareLocal(Session.java:410)
    at org.h2.server.TcpServerThread.process(TcpServerThread.java:221)
    at org.h2.server.TcpServerThread.run(TcpServerThread.java:136)
    at java.lang.Thread.run(Thread.java:637)

    at org.h2.engine.SessionRemote.done(SessionRemote.java:528)
    at org.h2.command.CommandRemote.prepare(CommandRemote.java:70)
    at org.h2.command.CommandRemote.<init>(CommandRemote.java:48)
    at org.h2.engine.SessionRemote.prepareCommand(SessionRemote.java:406)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1071)
    at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:71)
    at org.h2.jdbc.JdbcConnection.prepareAutoCloseStatement(JdbcConnection.java:255)
    at org.h2.jdbc.JdbcDatabaseMetaData.getTables(JdbcDatabaseMetaData.java:146)
    at org.dbunit.database.DefaultMetadataHandler.getTables(DefaultMetadataHandler.java:137)
    at org.dbunit.database.DatabaseDataSet.initialize(DatabaseDataSet.java:199)
    ... 25 more

What version of the product are you using? On what operating system, file
system, and virtual machine?
1.2.137 (relevant code unchanged in 1.2.138)
Mac OS 10.6.4 and Win XP
JDK1.6

Do you know a workaround?
No

How important/urgent is the problem for you?
Unit testing using dbUnit fails. Having to fall back to hsqldb; which doesn't 
support stored procedures as well.

In your view, is this a defect or a feature request?
Defect

Please provide any additional information below.

Original issue reported on code.google.com by gunther....@gmail.com on 29 Jun 2010 at 9:08

GoogleCodeExporter commented 9 years ago
Actually, you are using H2 version 1.1.112. The version number is encoded in 
the exception message, which is [42122-112].

Could you try again with version 1.2.137?

Original comment by thomas.t...@gmail.com on 29 Jun 2010 at 9:18

GoogleCodeExporter commented 9 years ago
Well that's embarrassing, the same stupid mistake on two different machines 
with different operating systems and architectures :-/ Sometimes run-anywhere 
can work against you...

I like the tagging of the log with the version, I must keep that in mind for my 
own projects.

Please feel free to expunge this from the history of the internet.

Original comment by gunther....@gmail.com on 1 Jul 2010 at 10:43

GoogleCodeExporter commented 9 years ago
The server should automatically detect that the client version is incompatible. 
This was not working yet in version 1.1.112; I hope it does work now.

Original comment by thomas.t...@gmail.com on 2 Jul 2010 at 3:15