• unknown's avatar
    WL#1689 "Map OPTIMIZE TABLE to ALTER TABLE for InnoDB" · 78492226
    unknown authored
    exactly it's mapped to "ALTER TABLE t; ANALYZE TABLE t;"
    
    
    sql/ha_innodb.cc:
      ::optimize() now returns "try ALTER and then analyze" instead of only analyze.
    sql/handler.h:
      new code to say "try alter and analyze".
    sql/mysql_priv.h:
      as we may now use mysql_alter_table() internally to ::optimize we must prevent it from talking to the client.
      New function mysql_recreate_table() which is the same as ALTER TABLE t;
    sql/sql_parse.cc:
      the big block removed here is moved into mysql_recreate_table().
    sql/sql_table.cc:
      In mysql_admin_table(): if the handler returns HA_ADMIN_TRY_ALTER,
      we close the table, recreate it, then open it and analyze it.
      This is currently used only for OPTIMIZE TABLE of an InnoDB table.
    78492226
ha_innodb.cc 146 KB