diff options
author | Annamalai Gurusami <annamalai.gurusami@oracle.com> | 2012-05-16 16:36:49 +0530 |
---|---|---|
committer | Annamalai Gurusami <annamalai.gurusami@oracle.com> | 2012-05-16 16:36:49 +0530 |
commit | ce9e6b5a9a8b10ec9b09ea4349c811cdff2ab95f (patch) | |
tree | 0edde2d1b7b595bc7d5bb09a29bd1c9be921c845 /storage | |
parent | 6b05e434bff43365add2a9636edbace157c84e89 (diff) | |
download | mariadb-git-ce9e6b5a9a8b10ec9b09ea4349c811cdff2ab95f.tar.gz |
Bug #13943231: ALTER TABLE AFTER DISCARD MAY CRASH THE SERVER
The following scenario crashes our mysql server:
1. set global innodb_file_per_table=1;
2. create table t1(c1 int) engine=innodb;
3. alter table t1 discard tablespace;
4. alter table t1 add unique index(c1);
Step 4 crashes the server. This patch introduces a check on discarded
tablespace to avoid the crash.
rb://1041 approved by Marko Makela
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innodb_plugin/handler/handler0alter.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/storage/innodb_plugin/handler/handler0alter.cc b/storage/innodb_plugin/handler/handler0alter.cc index e2702b157af..6f02b500d96 100644 --- a/storage/innodb_plugin/handler/handler0alter.cc +++ b/storage/innodb_plugin/handler/handler0alter.cc @@ -665,6 +665,10 @@ ha_innobase::add_index( DBUG_RETURN(HA_ERR_NO_SUCH_TABLE); } + if (innodb_table->tablespace_discarded) { + DBUG_RETURN(-1); + } + /* Check that index keys are sensible */ error = innobase_check_index_keys(key_info, num_of_keys, innodb_table); |