3446 Martin Skold 2011-08-31
Added final_add_index calls in backward compat layer for online add/drop index
modified:
mysql-test/t/disabled.def
sql/handler.cc
3445 Ole John Aske 2011-08-29
Added missing '}' which was lost during merge conflict resolution
modified:
cmake/configure.pl
=== modified file 'mysql-test/t/disabled.def'
--- a/mysql-test/t/disabled.def 2011-08-29 13:37:39 +0000
+++ b/mysql-test/t/disabled.def 2011-08-31 07:37:43 +0000
@@ -18,3 +18,5 @@ archive-big : Bug#11817185
file_contents : Bug#12585902 file_contents.test fails when building from "bzr export"
main.query_cache_28249 : Bug#12584161 2009-03-25 main.query_cache_28249 fails sporadically
log_tables-big : Bug#11756699 2010-11-15 mattiasj report already exists
+innodb_mysql_sync : Merge problems, DEBUG_SYNC wait conditions are not identical, Martin working on it
+
=== modified file 'sql/handler.cc'
--- a/sql/handler.cc 2011-08-29 13:37:39 +0000
+++ b/sql/handler.cc 2011-08-31 07:37:43 +0000
@@ -3668,6 +3668,10 @@ handler::alter_table_phase1(THD *thd,
table->key_info= save_key_info;
DBUG_RETURN(error);
}
+ /*
+ Save add_index_handle
+ */
+ alter_info->data= (void *) add;
}
if ((*alter_flags & dropping).is_set())
@@ -3676,6 +3680,17 @@ handler::alter_table_phase1(THD *thd,
uint *keyno_p;
uint *idx_p;
uint *idx_end_p;
+
+ /* Currently we must finalize add index if we also drop indexes */
+ if ((*alter_flags & adding).is_set())
+ {
+ if ((error= final_add_index((handler_add_index *)alter_info->data, true)))
+ {
+ print_error(error, MYF(0));
+ DBUG_RETURN(error);
+ }
+ }
+
DBUG_PRINT("info", ("Renumbering indexes"));
/* The prepare_drop_index() method takes an array of key numbers. */
key_numbers= (uint*) thd->alloc(sizeof(uint) * alter_info->index_drop_count);
@@ -3706,8 +3721,11 @@ handler::alter_table_phase2(THD *thd,
{
DBUG_ENTER("alter_table_phase2");
int error= 0;
+ HA_ALTER_FLAGS adding;
HA_ALTER_FLAGS dropping;
+ adding= adding | HA_ADD_INDEX | HA_ADD_UNIQUE_INDEX | HA_ADD_PK_INDEX |
+ HA_ALTER_INDEX | HA_ALTER_UNIQUE_INDEX | HA_ALTER_PK_INDEX;
dropping= dropping | HA_DROP_INDEX | HA_DROP_UNIQUE_INDEX |
HA_ALTER_INDEX | HA_ALTER_UNIQUE_INDEX | HA_ALTER_PK_INDEX;
@@ -3719,6 +3737,14 @@ handler::alter_table_phase2(THD *thd,
DBUG_RETURN(error);
}
}
+ else if ((*alter_flags & adding).is_set())
+ {
+ if ((error= final_add_index((handler_add_index *)alter_info->data, true)))
+ {
+ print_error(error, MYF(0));
+ DBUG_RETURN(error);
+ }
+ }
DBUG_RETURN(0);
}
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-5.5-cluster branch (Martin.Skold:3445 to 3446) | Martin Skold | 31 Aug |