List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:September 22 2010 4:09am
Subject:Re: question on mysql_alter_table
View as plain text  
Hello all,

Any ideas on how to do this? I guess what I am looking for is some way
to differentiate between using new_mysql_alter_table and
old_mysql_alter_table. I thought one way would be to query flags of
the engine of the table being altered, but if that is too complicated,
perhaps some other idea works?

Thoughts?

Thanks
-Zardosht

On Mon, Sep 20, 2010 at 12:26 AM, Zardosht Kasheff <zardosht@stripped> wrote:
> Hello all,
>
> I am trying to make a change to mysql_alter_table, but I want the
> change to apply only when the table being altered is created with my
> storage engine. So, I have two different versions of mysql_alter_table
> written, one named old_mysql_alter_table, which is the current
> functionality, and the other is new_mysql_alter_table, which has my
> changes.
>
> I would like to implement mysql_alter_table as such:
>    if (use_new) {
>        return new_mysql_alter_table(
>            thd,
>            new_db,
>            new_name,
>            create_info,
>            table_list,
>            alter_info,
>            order_num,
>            order,
>            ignore
>            );
>    }
>    else return old_mysql_alter_table(
>        thd,
>        new_db,
>        new_name,
>        create_info,
>        table_list,
>        alter_info,
>        order_num,
>        order,
>        ignore
>        );
>
> I do not know how to evaluate use_new. Ideally, I would do something
> like the following:
>    ulong alter_flags= 0;
>    alter_flags= table_list->table->s->db_type() ?
> table_list->table->s->db_type()->alter_table_flags(alter_info->flags)
> : 0;
>    bool use_new = (alter_flags & HA_FLAG_THAT_ONLY_MY_ENGINE_HAS) ?
> true:false;
>
> The problem is that table_list->table is not yet set, and I do not see
> how to get easily get access to the table that is about to be altered.
>
> Any ideas on how I could solve this problem?
>
> Thanks
> -Zardosht
>
Thread
question on mysql_alter_tableZardosht Kasheff20 Sep
  • Re: question on mysql_alter_tableKonstantin Osipov20 Sep
    • Re: question on mysql_alter_tableZardosht Kasheff20 Sep
  • Re: question on mysql_alter_tableZardosht Kasheff22 Sep
    • Re: question on mysql_alter_tableSergei Golubchik22 Sep
      • Re: question on mysql_alter_tableZardosht Kasheff22 Sep