mysql fail generating index for index property on column tag
-------------------------------------------------------------
Key: HHH-3015
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-3015
Project: Hibernate3
Issue Type: Improvement
Affects Versions: 3.2.5
Environment: Hibernate 3.2.5, database mysql 5.0.41
Reporter: Marco Oreste Pogliaghi
Priority: Minor
Having a table definition of this type:
------------------------------------
<hibernate-mapping>
<class name="my.Table" table="mytable">
<id name="id" type="java.lang.Integer">
<column name="id" />
<generator class="native" />
</id>
<property name="code" type="java.lang.String">
<column name="code"
length="6"
unique="true"
index="mytable_code_idx" />
</property>
</hibernate-mapping>
------------------------------
when translating index property for field code, the generated sql for mysql is:
create index mytable_code_idx on mytable(code)
if the user has no full index privilege, this line result in an error:
INDEX command denied to user...
translating the generation of the index as
alter table mytable add index mytable_code_idx (code)
will succed also for user with index privileges only on the table.
--
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