From: Zardosht Kasheff Date: September 22 2010 2:28pm Subject: Re: question on mysql_alter_table List-Archive: http://lists.mysql.com/internals/38110 Message-Id: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hello Sergei, Thanks for the suggestion. I will look into this. I am still hoping for something that is storage engine based, because making users be sure to set a variable for our engine and unset it for other engines may be a pain. But if this is the only safe and easy option, then perhaps it will work. Does anyone have any ideas on how to make this engine-based? Thanks -Zardosht On Wed, Sep 22, 2010 at 2:29 AM, Sergei Golubchik wrote= : > Hi, Zardosht! > > On Sep 22, Zardosht Kasheff wrote: >> 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? > > if you looking for something simple, consider new_mode: > > =A0if (thd->variables.new_mode) > =A0 =A0return new_mysql_alter_table(...) > =A0else > =A0 =A0return old_mysql_alter_table(...) > > Or old_mode: > > =A0if (!global_system_variables.old_mode) > =A0 =A0return new_mysql_alter_table(...) > =A0else > =A0 =A0return old_mysql_alter_table(...) > > Or old_alter_table: > > =A0if (!thd->variables.old_alter_table) > =A0 =A0return new_mysql_alter_table(...) > =A0else > =A0 =A0return old_mysql_alter_table(...) > > All these already exist as mysqld command line options and system > variables. First and third are session variables, second is a global one. > >> Thoughts? >> >> Thanks >> -Zardosht >> > Regards, > Sergei >