MySql index duplication
-----------------------
Key: HBX-1104
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HBX-1104
Project: Hibernate Tools
Issue Type: Bug
Components: reverse-engineer
Affects Versions: 3.2.0.GA
Environment: Hibernate 3.2, MySql 5.0, HibernateExt built from SVN revision 15749
(
http://anonsvn.jboss.org/repos/hibernate/branches/Branch_3_2/HibernateExt).
Reporter: Hugh Daschbach
Attachments: hibernate-tools.patch
When I run hbm2ddl schema update, the reverse engineer process generates indicies and
constraints that are already defined in the running schema.
This looks much like
http://opensource.atlassian.com/projects/hibernate/browse/HB-1114 and
http://opensource.atlassian.com/projects/hibernate/browse/HB-1196. So I risk submitting
what may be regarded as a duplicate bug. But I have an alternate solution to propose.
I see the patch attached to HB-1196 in the hibernate-3.2 source code. But I think this
may be a band-aid over an issue in the reveng code.
There seems to be two issues in JDBCBinder:bindOneToMany(). The first is that the new
collection is created and passed to the secondPass processor whether the associate
foreign key exists or not. The second is that the foreign key name is not associated with
the keyValue attached to the new collection.
The attached patch fixes both these issues and prevents creation of duplicate indexes for
schema like that that describe in HB-1196.
I don't know if this has any adverse implications for other dialects. But I submit it
because I think it's worth consideration.
--
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