[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-961) invalid column name in H2MetaDataDialect getSuggestedPrimaryKeyStrategyName query

Dan Allen (JIRA) noreply at atlassian.com
Thu Oct 4 23:24:25 EDT 2007


    [ http://opensource.atlassian.com/projects/hibernate/browse/HBX-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_28364 ] 

Dan Allen commented on HBX-961:
-------------------------------

Wow, I don't even need to provide a test case. The one that is included with Hibernate Tools doesn't even pass. I used the latest JAR file from the H2 project. I placed the file in tools/lib/testlibs/, changed the tools/etc/hibernate.properties to use H2 and ran

ant junitsingle -Dtestname=org.hibernate.tool.test.jdbc2cfg.identity.H2IdentityTest

Here is the output

Testcase: testAutoIncrement took 1.103 sec
    Caused an ERROR
Could not get list of tables from database. Probably a JDBC driver problem.
org.hibernate.exception.SQLGrammarException: Could not get list of tables from database. Probably a JDBC driver problem.
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:67)
    at org.hibernate.cfg.reveng.dialect.H2MetaDataDialect.getSuggestedPrimaryKeyStrategyName(H2MetaDataDialect.java:78)
    at org.hibernate.cfg.reveng.JDBCReader.processPrimaryKey(JDBCReader.java:416)
    at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:86)
    at org.hibernate.cfg.reveng.JDBCReader.readDatabaseSchema(JDBCReader.java:837)
    at org.hibernate.cfg.JDBCBinder.readDatabaseSchema(JDBCBinder.java:115)
    at org.hibernate.cfg.JDBCBinder.readFromDatabase(JDBCBinder.java:88)
    at org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC(JDBCMetaDataConfiguration.java:40)
    at org.hibernate.tool.JDBCMetaDataBinderTestCase.setUp(JDBCMetaDataBinderTestCase.java:142)
Caused by: org.h2.jdbc.JdbcSQLException: Column IDX.TABLE_CATNAME not found [42S22-59]
    at org.h2.message.Message.addSQL(Message.java:145)
    at org.h2.command.Parser.prepareCommand(Parser.java:219)
    at org.h2.engine.Session.prepareLocal(Session.java:172)
    at org.h2.engine.Session.prepareCommand(Session.java:154)
    at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:971)
    at org.h2.jdbc.JdbcPreparedStatement.<init>(JdbcPreparedStatement.java:1208)
    at org.h2.jdbc.JdbcConnection.prepareStatement(JdbcConnection.java:165)
    at org.hibernate.cfg.reveng.dialect.H2MetaDataDialect.getSuggestedPrimaryKeyStrategyName(H2MetaDataDialect.java:58)
Caused by: org.h2.jdbc.JdbcSQLException: Column IDX.TABLE_CATNAME not found [42S22-59]
    at org.h2.message.Message.getSQLException(Message.java:84)
    at org.h2.message.Message.getSQLException(Message.java:88)
    at org.h2.message.Message.getSQLException(Message.java:66)
    at org.h2.expression.ExpressionColumn.optimize(ExpressionColumn.java:122)
    at org.h2.expression.CompareLike.optimize(CompareLike.java:67)
    at org.h2.expression.ConditionAndOr.optimize(ConditionAndOr.java:122)
    at org.h2.expression.ConditionAndOr.optimize(ConditionAndOr.java:121)
    at org.h2.expression.ConditionAndOr.optimize(ConditionAndOr.java:121)
    at org.h2.command.dml.Select.prepare(Select.java:478)
    at org.h2.command.Parser.prepareCommand(Parser.java:200)

> invalid column name in H2MetaDataDialect getSuggestedPrimaryKeyStrategyName query
> ---------------------------------------------------------------------------------
>
>                 Key: HBX-961
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HBX-961
>             Project: Hibernate Tools
>          Issue Type: Bug
>          Components: reverse-engineer
>    Affects Versions: 3.2beta10
>         Environment: H2, version: 1.0 (2007-06-17)
>            Reporter: Dan Allen
>         Attachments: HBX-961-v1.txt, HBX-961-v2.txt
>
>   Original Estimate: 5 minutes
>  Remaining Estimate: 5 minutes
>
> There is an invalid column name used in the query to get the primary keys for a table.  The query uses the column name TABLE_CATNAME but the appropriate name of the column is TABLE_CATALOG.  A patch is supplied.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the hibernate-issues mailing list