List:Internals« Previous MessageNext Message »
From:Sergei Golubchik Date:September 22 2010 6:29am
Subject:Re: question on mysql_alter_table
View as plain text  
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:

  if (thd->variables.new_mode)
    return new_mysql_alter_table(...)
  else
    return old_mysql_alter_table(...)

Or old_mode:

  if (!global_system_variables.old_mode)
    return new_mysql_alter_table(...)
  else
    return old_mysql_alter_table(...)

Or old_alter_table:

  if (!thd->variables.old_alter_table)
    return new_mysql_alter_table(...)
  else
    return 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
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