[hibernate-issues] [Hibernate-JIRA] Commented: (HBX-961) invalid column name in H2MetaDataDialect getSuggestedPrimaryKeyStrategyName query
Dan Allen (JIRA)
noreply at atlassian.com
Mon Jul 16 10:48:52 EDT 2007
[ http://opensource.atlassian.com/projects/hibernate/browse/HBX-961?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_27520 ]
Dan Allen commented on HBX-961:
-------------------------------
Well, see it is not dependent on the version. The SQL query that is pieced together is just using an inconsistent name for the column.
String sql = "SELECT idx.TABLE_CATALOG TABLE_CAT, idx.TABLE_SCHEMA TABLE_SCHEM, idx.TABLE_NAME, idx.COLUMN_NAME, cols.COLUMN_DEFAULT COLUMN_DEFAULT FROM " +
... (removed)...
if(catalog!=null) {
sql += "AND idx.TABLE_CATNAME like '" + catalog + "' ";
}
As you can see in the SQL above, the same column is referred to using two different name. Clearly there is a typo here.
http://anonhibernate.labs.jboss.com/branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/cfg/reveng/dialect/H2MetaDataDialect.java
> 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