summaryrefslogtreecommitdiff
path: root/sql/sql_rename.cc
diff options
context:
space:
mode:
authorMonty <monty@mariadb.org>2020-03-30 14:50:03 +0300
committerMonty <monty@mariadb.org>2020-04-19 17:33:51 +0300
commiteca5c2c67ff1854b186b0e1b8dd342cb988e94d2 (patch)
tree7a6f35362dfc38469f0842cc98c0c28fd02236e4 /sql/sql_rename.cc
parent78357796e8069f8cd041ea0bb0f5802234bdd2bc (diff)
downloadmariadb-git-eca5c2c67ff1854b186b0e1b8dd342cb988e94d2.tar.gz
Added support for more functions when using partitioned S3 tables
MDEV-22088 S3 partitioning support All ALTER PARTITION commands should now work on S3 tables except REBUILD PARTITION TRUNCATE PARTITION REORGANIZE PARTITION In addition, PARTIONED S3 TABLES can also be replicated. This is achived by storing the partition tables .frm and .par file on S3 for partitioned shared (S3) tables. The discovery methods are enchanced by allowing engines that supports discovery to also support of the partitioned tables .frm and .par file Things in more detail - The .frm and .par files of partitioned tables are stored in S3 and kept in sync. - Added hton callback create_partitioning_metadata to inform handler that metadata for a partitoned file has changed - Added back handler::discover_check_version() to be able to check if a table's or a part table's definition has changed. - Added handler::check_if_updates_are_ignored(). Needed for partitioning. - Renamed rebind() -> rebind_psi(), as it was before. - Changed CHF_xxx hadnler flags to an enum - Changed some checks from using table->file->ht to use table->file->partition_ht() to get discovery to work with partitioning. - If TABLE_SHARE::init_from_binary_frm_image() fails, ensure that we don't leave any .frm or .par files around. - Fixed that writefrm() doesn't leave unusable .frm files around - Appended extension to path for writefrm() to be able to reuse to function for creating .par files. - Added DBUG_PUSH("") to a a few functions that caused a lot of not critical tracing.
Diffstat (limited to 'sql/sql_rename.cc')
-rw-r--r--sql/sql_rename.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/sql/sql_rename.cc b/sql/sql_rename.cc
index 0200113deae..5fafd9fa28a 100644
--- a/sql/sql_rename.cc
+++ b/sql/sql_rename.cc
@@ -335,6 +335,7 @@ do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db,
if (hton->flags & HTON_TABLE_MAY_NOT_EXIST_ON_SLAVE)
*force_if_exists= 1;
+ thd->replication_flags= 0;
if (!(rc= mysql_rename_table(hton, &ren_table->db, &old_alias,
new_db, &new_alias, 0)))
{
@@ -357,6 +358,8 @@ do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db,
&ren_table->db, &old_alias, NO_FK_CHECKS);
}
}
+ if (thd->replication_flags & OPTION_IF_EXISTS)
+ *force_if_exists= 1;
}
else
{
@@ -398,8 +401,8 @@ do_rename(THD *thd, TABLE_LIST *ren_table, const LEX_CSTRING *new_db,
empty.
RETURN
- false Ok
- true rename failed
+ 0 Ok
+ table pointer to the table list element which rename failed
*/
static TABLE_LIST *