summaryrefslogtreecommitdiff
path: root/sql/sql_alter.cc
diff options
context:
space:
mode:
authorAleksey Midenkov <midenok@gmail.com>2021-09-07 20:46:53 +0300
committerAleksey Midenkov <midenok@gmail.com>2021-09-10 20:09:35 +0300
commit5b3ed2cad156205d98b31dfd69e9bab5898df046 (patch)
treecb4b335fd528248c70e210a3fb5062ba92925d42 /sql/sql_alter.cc
parent90724c78f70160ee042a1f7ef6a12b47fc257cc5 (diff)
downloadmariadb-git-bb-10.7-midenok-MDEV-22165.tar.gz
MDEV-22165 CONVERT TABLE: move in partition from existing tablebb-10.7-midenok-MDEV-22165
Syntax for CONVERT TABLE ALTER TABLE tbl_name [alter_option [, alter_option] ...] | [partition_options] partition_option: { ... | CONVERT TABLE tbl_name TO PARTITION partition_name partition_spec } Examples: ALTER TABLE t1 CONVERT TABLE tp2 TO PARTITION p2 VALUES LESS THAN MAX_VALUE(); New ALTER_PARTITION_CONVERT_IN command for fast_alter_partition_table() is done in alter_partition_convert_in() function which basically does ha_rename_table(). Table structure and data check is basically the same as in EXCHANGE PARTITION command. And these are done by compare_table_with_partition() and check_table_data(). Atomic DDL is done by the scheme from MDEV-22166 (see the corresponding commit message). The only differnce is that it also has to drop source table frm and that is done by WFRM_DROP_CONVERTED_FROM.
Diffstat (limited to 'sql/sql_alter.cc')
-rw-r--r--sql/sql_alter.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/sql/sql_alter.cc b/sql/sql_alter.cc
index 889eca2f4ba..747449f9718 100644
--- a/sql/sql_alter.cc
+++ b/sql/sql_alter.cc
@@ -440,8 +440,8 @@ bool Sql_cmd_alter_table::execute(THD *thd)
as for RENAME TO, as being done by SQLCOM_RENAME_TABLE
*/
if ((alter_info.partition_flags & ALTER_PARTITION_DROP) ||
+ (alter_info.partition_flags & ALTER_PARTITION_CONVERT_IN) ||
(alter_info.partition_flags & ALTER_PARTITION_CONVERT_OUT) ||
- (alter_info.partition_flags & ALTER_PARTITION_ADD_FROM_TABLE) ||
(alter_info.flags & ALTER_RENAME))
priv_needed|= DROP_ACL;