summaryrefslogtreecommitdiff
path: root/sql/handler.h
diff options
context:
space:
mode:
authorMattias Jonsson <mattias.jonsson@oracle.com>2010-11-05 12:01:10 +0100
committerMattias Jonsson <mattias.jonsson@oracle.com>2010-11-05 12:01:10 +0100
commit6c2c6118b36b2953b144b833c315220f56533162 (patch)
tree8b7276925b9532dc104baed751d879884fedf169 /sql/handler.h
parent3202c98c929a3ae820ea129b3515c1b288e0ee65 (diff)
downloadmariadb-git-6c2c6118b36b2953b144b833c315220f56533162.tar.gz
Bug#57778: failed primary key add to partitioned innodb table inconsistent and crashes
It was possible to issue an ALTER TABLE ADD PRIMARY KEY on an partitioned InnoDB table that failed and crashed the server. The problem was that it succeeded to create the PK on at least one partition, and then failed on a subsequent partition, due to duplicate key violation. Since the partitions that already had added the PK was not reverted all partitions was not consistent with the table definition, which caused the crash. The solution was to add a revert step to ha_partition::add_index() that dropped the index for the already succeeded partitions, on failure.
Diffstat (limited to 'sql/handler.h')
-rw-r--r--sql/handler.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/sql/handler.h b/sql/handler.h
index 325df003215..0e03ea17dde 100644
--- a/sql/handler.h
+++ b/sql/handler.h
@@ -174,6 +174,8 @@
/*
These bits are set if different kinds of indexes can be created
off-line without re-create of the table (but with a table lock).
+ Partitioning needs both ADD and DROP to be supported by its underlying
+ handlers, due to error handling, see bug#57778.
*/
#define HA_ONLINE_ADD_INDEX_NO_WRITES (1L << 0) /*add index w/lock*/
#define HA_ONLINE_DROP_INDEX_NO_WRITES (1L << 1) /*drop index w/lock*/