[Hibernate-JIRA] Created: (HHH-5772) hibernate.test.unionsubclass2 has "create index" problem with Teradata
by David Repshas (JIRA)
hibernate.test.unionsubclass2 has "create index" problem with Teradata
----------------------------------------------------------------------
Key: HHH-5772
URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5772
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.5.3
Environment: Hibernate 3.5.3 on Windows against a Teradata 13.0 Database
Reporter: David Repshas
…
[View More] Attachments: IndexDiffs.zip
Here's the details from the log file:
=======================================
14:54:34,535 DEBUG SchemaExport:377 -
create index UCustomerAddressIndex on UCustomer (address, zip)
14:54:34,551 ERROR SchemaExport:348 - Unsuccessful: create index UCustomerAddressIndex on UCustomer (address, zip)
14:54:34,551 ERROR SchemaExport:349 - [Teradata Database] [TeraJDBC 13.00.00.12] [Error 3706] [SQLState 42000] Syntax error: Must specify index field(s) for CREATE INDEX.
14:54:34,551 DEBUG SchemaExport:377 -
================
The problem is that Teradata requires
the names of one or more columns whose values are to be indexed.
So:
create index index1 () on T_USER
will fail while:
create index index1 (user_name) on T_USER
will succeed
This can be fixed as follows:
1) Add the following method to Dialect.java
public boolean doesCreateIndexRequireColumnNames() {
return false;
}
2) Add the same method to TeradataDialect.java, but have it
return "true".
3) Add new code to org.hibernate.mapping.index in
buildSqlCreateIndexString() to add the column names
(code differences against Hibernate 3.5.3 are in attched diff file)
--
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....
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
[View Less]
14 years