• unknown's avatar
    Worklog#1563 - Support of on-line CREATE/DROP INDEX. · c7534fad
    unknown authored
    This is to enable table handlers to implement online create/drop index.
    It consists of some parts:
    - New default handler methods in handler.h
    - Split of mysql_alter_table. It decides if only one kind of
      alteration is to be done (e.g. only create indexes or only drop
      indexes etc.) It then calls the specialized new handler method if
      the handler implements it. Otherwise it calls real_alter_table.
    - The parser sets flags for each alter operation detected in a
      command. These are used by mysql_alter_table for the decision.
    - mysql_prepare_table is pulled out of mysql_create_table. This is
      also used by mysql_create_index to prepare the key structure array
      for the handler. It is also used by mysql_create_index and
      mysql_drop_index to prepare a call to mysql_create_frm.
    - mysql_create_frm is pulled out of rea_create_table for use by
      mysql_create_index and mysql_drop_index after the index is
      created/dropped.
    Thanks to Antony who supplied most of the changes.
    
    
    sql/handler.h:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      New virtual handler methods with default implementation and return flags.
    sql/mysql_priv.h:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      New function prototypes. mysql_prepare_table is pulled out of
      mysql_create_table. It prepares a table structure, which is used by 
      mysql_create_table, mysql_create_index and mysql_drop_index.
      real_alter_table is pulled out of mysql_alter_table. The latter only
      looks if the requested operation can be done by specialized functions
      or else calls real_alter_table, which does the real thing.
      mysql_add_column and mysql_drop_colunm are for future use. They simply
      call real_alter_table. mysql_create_frm is pulled out of
      rea_create_table. It is called also from mysql_create_index and
      mysql_drop_index after successful create/drop index.
      mysql_alter_table prototype is extended by the new alter_flags argument.
    sql/sql_base.cc:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      mysql_create_index and mysql_drop_index moved to sql_table.cc.
    sql/sql_lex.h:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      Definitions for the new alter_flags.
    sql/sql_parse.cc:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      Extend the calls to mysql_alter_table by the new alter_flags argument.
    sql/sql_table.cc:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      mysql_prepare_table is pulled out of mysql_create_table.
      mysql_create_index and mysql_drop_index are changed so that they use
      the new handler functions if the handler implements them.
      mysql_add_column and mysql_drop_column are for future use. They simply
      call real_alter_table. mysql_alter_table only decides which function
      to use for the requested operation. real_alter_table implements most
      of what mysql_alter_table did before.
    sql/sql_yacc.yy:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      Set the alter_flags where appropriate.
    sql/unireg.cc:
      Worklog#1563 - Support of on-line CREATE/DROP INDEX.
      mysql_create_frm is pulled out of rea_create_table.
    c7534fad
mysql_priv.h 44.5 KB