Bug #29531 umbiguity possible with index type in 'create index' statement
Submitted: 3 Jul 2007 20:31 Modified: 3 Jul 2007 20:44
Reporter: Sergei Tkachenko Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: index umbiguity

[3 Jul 2007 20:31] Sergei Tkachenko
Description:
There are two places in 'create index' statement, where user can specify index type. Parser allows cases when specified index types are different. In that cases last specified index type is assigned to index. That's wrong to accept inconsistent statements.

How to repeat:
execute following statement:

CREATE INDEX index1
using hash
ON
test.table1(f01(10))
using btree;

result:
index created & it's btree

Suggested fix:
Would be right to leave only one of possible ways to set index types, but if compatibility is strongly required then some checking proc. should be added that will ensure that statement is consistent.
[3 Jul 2007 20:44] Sveta Smirnova
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://dev.mysql.com/doc/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

There is note at http://dev.mysql.com/doc/refman/5.1/en/create-index.html:

Note: Before MySQL 5.1.10, this option can be given only before the ON tbl_name clause. Use of the option in this position is deprecated as of 5.1.10; support for it is to be dropped in a future MySQL release.