List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:September 20 2010 4:26am
Subject:question on mysql_alter_table
View as plain text  
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) {
        bool failed = 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