diff options
author | Sergei Golubchik <serg@mariadb.org> | 2022-05-10 11:53:59 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2022-05-10 14:01:23 +0200 |
commit | 3bc98a4ec4e7e7493ee93048dddfad87ceb3d8ff (patch) | |
tree | ad189995a78fdc6068059e65b8455d3d4e61e719 /sql/ha_partition.cc | |
parent | f4d671bff2c4dcfe1bb2af6d40122576e4fcfa91 (diff) | |
parent | fe3d07cab82b2215dc64f52ac93122072c33d021 (diff) | |
download | mariadb-git-3bc98a4ec4e7e7493ee93048dddfad87ceb3d8ff.tar.gz |
Merge branch '10.5' into 10.6
Diffstat (limited to 'sql/ha_partition.cc')
-rw-r--r-- | sql/ha_partition.cc | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index 75fe579ebe9..19fb2a9357d 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -1,6 +1,6 @@ /* Copyright (c) 2005, 2019, Oracle and/or its affiliates. - Copyright (c) 2009, 2021, MariaDB + Copyright (c) 2009, 2022, MariaDB This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -4172,6 +4172,8 @@ int ha_partition::external_lock(THD *thd, int lock_type) if (lock_type == F_UNLCK) { bitmap_clear_all(used_partitions); + if (m_lock_type == F_WRLCK && m_part_info->vers_require_hist_part(thd)) + m_part_info->vers_check_limit(thd); } else { @@ -4192,13 +4194,7 @@ int ha_partition::external_lock(THD *thd, int lock_type) { if (m_part_info->part_expr) m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0); - if (m_part_info->part_type == VERSIONING_PARTITION && - /* TODO: MDEV-20345 exclude more inapproriate commands like INSERT - These commands may be excluded because working history partition is needed - only for versioned DML. */ - thd->lex->sql_command != SQLCOM_SELECT && - thd->lex->sql_command != SQLCOM_INSERT_SELECT && - (error= m_part_info->vers_set_hist_part(thd))) + if ((error= m_part_info->vers_set_hist_part(thd))) goto err_handler; } DBUG_RETURN(0); @@ -4344,11 +4340,7 @@ int ha_partition::start_stmt(THD *thd, thr_lock_type lock_type) { if (m_part_info->part_expr) m_part_info->part_expr->walk(&Item::register_field_in_read_map, 1, 0); - if (m_part_info->part_type == VERSIONING_PARTITION && - // TODO: MDEV-20345 (see above) - thd->lex->sql_command != SQLCOM_SELECT && - thd->lex->sql_command != SQLCOM_INSERT_SELECT) - error= m_part_info->vers_set_hist_part(thd); + error= m_part_info->vers_set_hist_part(thd); } DBUG_RETURN(error); } @@ -10586,7 +10578,16 @@ bool ha_partition::commit_inplace_alter_table(TABLE *altered_table, Loop over all other partitions as to follow the protocol! */ uint i; - DBUG_ASSERT(0); + /* + InnoDB does not set ha_alter_info->group_commit_ctx to NULL in the + case if autoincrement attribute is necessary to reset for all + partitions for INNOBASE_INPLACE_IGNORE handler flags. It does not + affect durability, because it is solely about updating the InnoDB data + dictionary caches (one InnoDB dict_table_t per partition or + sub-partition). + */ + DBUG_ASSERT(table->found_next_number_field + && !altered_table->found_next_number_field); for (i= 1; i < m_tot_parts; i++) { ha_alter_info->handler_ctx= part_inplace_ctx->handler_ctx_array[i]; |