Index: mysql-5.1/storage/innobase/mysql-test/innodb.test =================================================================== --- mysql-5.1/storage/innobase/mysql-test/innodb.test (revision 1941) +++ mysql-5.1/storage/innobase/mysql-test/innodb.test (working copy) @@ -13,6 +13,13 @@ -- source include/not_embedded.inc -- source include/have_innodb.inc + +create table t1(a int not null, b int, c char(10) not null, unique (c)) +engine = innodb; +show create table t1; +drop index c on t1; +drop table t1; + -- source include/have_log_bin.inc # Disabling it temporarily for statement-based logging since some Index: mysql-5.1/storage/innobase/handler/ha_innodb.cc =================================================================== --- mysql-5.1/storage/innobase/handler/ha_innodb.cc (revision 1941) +++ mysql-5.1/storage/innobase/handler/ha_innodb.cc (working copy) @@ -546,6 +546,21 @@ innobase_release_temporary_latches( return 0; } +/******************************************************************** +Return alter table flags supported in an InnoDB database. */ +static +uint +innobase_alter_table_flags( +/*=======================*/ + uint flags) +{ + return(HA_ONLINE_ADD_INDEX_NO_WRITES + | HA_ONLINE_DROP_INDEX_NO_WRITES + | HA_ONLINE_ADD_UNIQUE_INDEX_NO_WRITES + | HA_ONLINE_DROP_UNIQUE_INDEX_NO_WRITES + | HA_ONLINE_ADD_PK_INDEX_NO_WRITES); +} + /************************************************************************ Increments innobase_active_counter and every INNOBASE_WAKE_INTERVALth time calls srv_active_wake_master_thread. This function should be used @@ -1447,6 +1462,7 @@ innobase_init( innobase_hton->show_status=innobase_show_status; innobase_hton->flags=HTON_NO_FLAGS; innobase_hton->release_temporary_latches=innobase_release_temporary_latches; + innobase_hton->alter_table_flags = innobase_alter_table_flags; ut_a(DATA_MYSQL_TRUE_VARCHAR == (ulint)MYSQL_TYPE_VARCHAR); @@ -7851,6 +7867,21 @@ bool ha_innobase::check_if_incompatible_ return COMPATIBLE_DATA_YES; } +/*********************************************************************** +Prepare to drop some indexes of a table. */ + +int +ha_innobase::prepare_drop_index( +/*============================*/ + /* out: 0 or error number */ + TABLE* table, /* in: Table where indexes are dropped */ + uint* key_num, /* in: Key nums to be dropped */ + uint num_of_keys) /* in: Number of keys to be dropped */ +{ + my_error(ER_REQUIRES_PRIMARY_KEY, MYF(0)); + return(ER_REQUIRES_PRIMARY_KEY); +} + static int show_innodb_vars(THD *thd, SHOW_VAR *var, char *buff) { innodb_export_status(); Index: mysql-5.1/storage/innobase/handler/ha_innodb.h =================================================================== --- mysql-5.1/storage/innobase/handler/ha_innodb.h (revision 1941) +++ mysql-5.1/storage/innobase/handler/ha_innodb.h (working copy) @@ -196,6 +196,8 @@ class ha_innobase: public handler int cmp_ref(const uchar *ref1, const uchar *ref2); bool check_if_incompatible_data(HA_CREATE_INFO *info, uint table_changes); + int prepare_drop_index(TABLE *table_arg, uint *key_num, + uint num_of_keys); }; /* Some accessor functions which the InnoDB plugin needs, but which