I believe, and it has been a while so I can't provide exact pointers,
that the ha_create process (which is where the CREATE INDEX gets
processed), does ask the storage engine for the supported index types.
You should read through the processing in
<mysql_source>/sql/handler.cc, handler.h, and table.cc
It has been my experience in writing storage engines that you don't
need to alter the MySQL source to do some interesting things. But you do
need to know all the ins and outs of the processing.
On 4/24/13 5:59 AM, AugustQ wrote:
> Hi,
>
> and thanks for your hints.
>
> Here is what I did: I created a tiny storage engine which inherits its
> functionality from MyIsam. I can load this code and so I created a table
> with this type of storage engine.
>
> Next I wanted to see what my storage engine can do if I add an index to
> this table.
>
> If I create an index without specifying an index-type everything works.
> In the ::create(()-function I see the columns that describe the index.
>
> When I create an index using an index-engine-type by giving the keyword
> engine or type or using in the CREATE-stmt, it works when I use one of
> the keywords given in the description like BTREE or HASH. But when I
> create an index using my own keyword then I got immediately the syntax
> error.
>
> In my example I used the word AQTREE for the description of the
> index-engine. I wanted to see at the storage-engine-level, what
> information was given to my code but this storage engine (my code) was
> never called.
>
> What I expected: MySQL offers the choice of adding another storage
> engine without modifying the source code of MySQL itself. So I assumed
> that this would include the creating and handling of an index.
>
> Is this possible?
>
> Thanks
> AugustQ