diff options
author | unknown <mikael@dator6.(none)> | 2008-01-28 15:20:55 +0100 |
---|---|---|
committer | unknown <mikael@dator6.(none)> | 2008-01-28 15:20:55 +0100 |
commit | 516f95acea961ed8e7c550ba49acdd884678058c (patch) | |
tree | eee66d997bf96e08c1fdff43a4307896443a02c8 /sql/sql_table.cc | |
parent | 4bacd53715ac860c6ba2d9c148f87d22cae9c62a (diff) | |
download | mariadb-git-516f95acea961ed8e7c550ba49acdd884678058c.tar.gz |
BUG#32943: Fixed buggy lock handling of ALTER TABLE for partitioning
mysql-test/r/partition_range.result:
Added new test cases for lock tables and ALTER TABLE for
partitions, also added a test case with a trigger.
mysql-test/t/partition_range.test:
Added new test cases for lock tables and ALTER TABLE for
partitions, also added a test case with a trigger.
sql/mysql_priv.h:
Added WFRM_KEEP_SHARE for use of code not to be used otherwise
sql/sql_partition.cc:
Removed get_name_lock and release_name_lock, use
close_data_files_and_morph_locks which leaves an
exclusive name lock after completing.
Reopen table after completing if under lock tables
Updated comments
sql/sql_table.cc:
Ensure that code to set partition syntax isn't used other than
when specifically asked to do it.
Diffstat (limited to 'sql/sql_table.cc')
-rw-r--r-- | sql/sql_table.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 505bcd1b421..a0464d43372 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -1226,8 +1226,12 @@ uint build_table_shadow_filename(char *buff, size_t bufflen, flags Flags as defined below WFRM_INITIAL_WRITE If set we need to prepare table before creating the frm file - WFRM_CREATE_HANDLER_FILES If set we need to create the handler file as - part of the creation of the frm file + WFRM_INSTALL_SHADOW If set we should install the new frm + WFRM_KEEP_SHARE If set we know that the share is to be + retained and thus we should ensure share + object is correct, if not set we don't + set the new partition syntax string since + we know the share object is destroyed. WFRM_PACK_FRM If set we should pack the frm file and delete the frm file @@ -1370,7 +1374,7 @@ bool mysql_write_frm(ALTER_PARTITION_PARAM_TYPE *lpt, uint flags) goto err; } #ifdef WITH_PARTITION_STORAGE_ENGINE - if (part_info) + if (part_info && (flags & WFRM_KEEP_SHARE)) { TABLE_SHARE *share= lpt->table->s; char *tmp_part_syntax_str; |