diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-04 17:04:55 +0200 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-05-04 17:04:55 +0200 |
commit | 8cbb14ef5d180687f131bc44a4e8fc84083d033c (patch) | |
tree | 091f11e2d20f95656a7b12294782eb0488fd4fcc /storage/innobase | |
parent | 4345868382ca3525de5eb432302b6b9b957b47c1 (diff) | |
parent | b85aa20065504bdda4bc03c2bd7eb7de38865c5d (diff) | |
download | mariadb-git-8cbb14ef5d180687f131bc44a4e8fc84083d033c.tar.gz |
Merge branch '10.1' into 10.2
Diffstat (limited to 'storage/innobase')
-rw-r--r-- | storage/innobase/dict/dict0stats.cc | 4 | ||||
-rw-r--r-- | storage/innobase/handler/handler0alter.cc | 21 | ||||
-rw-r--r-- | storage/innobase/include/handler0alter.h | 11 |
3 files changed, 30 insertions, 6 deletions
diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index d6d7845b2c3..6dd3c9c930f 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2009, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2009, 2019, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2015, 2018, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -3109,6 +3109,8 @@ dict_stats_update_for_index( if (dict_stats_persistent_storage_check(false)) { dict_table_stats_lock(index->table, RW_X_LATCH); dict_stats_analyze_index(index); + index->table->stat_sum_of_other_index_sizes + += index->stat_index_size; dict_table_stats_unlock(index->table, RW_X_LATCH); dict_stats_save(index->table, &index->id); DBUG_VOID_RETURN; diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index 005c0fd5adf..f470ac3ca4c 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -1,6 +1,6 @@ /***************************************************************************** -Copyright (c) 2005, 2018, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2005, 2019, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2013, 2019, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under @@ -251,6 +251,23 @@ struct ha_innobase_inplace_ctx : public inplace_alter_handler_ctx } } + /** Share context between partitions. + @param[in] ctx context from another partition of the table */ + void set_shared_data(const inplace_alter_handler_ctx& ctx) + { + if (add_autoinc != ULINT_UNDEFINED) { + const ha_innobase_inplace_ctx& ha_ctx = + static_cast<const ha_innobase_inplace_ctx&> + (ctx); + /* When adding an AUTO_INCREMENT column to a + partitioned InnoDB table, we must share the + sequence for all partitions. */ + ut_ad(ha_ctx.add_autoinc == add_autoinc); + ut_ad(ha_ctx.sequence.last()); + sequence = ha_ctx.sequence; + } + } + private: // Disable copying ha_innobase_inplace_ctx(const ha_innobase_inplace_ctx&); @@ -4312,7 +4329,7 @@ prepare_inplace_alter_table_dict( (ha_alter_info->handler_ctx); DBUG_ASSERT((ctx->add_autoinc != ULINT_UNDEFINED) - == (ctx->sequence.m_max_value > 0)); + == (ctx->sequence.max_value() > 0)); DBUG_ASSERT(!ctx->num_to_drop_index == !ctx->drop_index); DBUG_ASSERT(!ctx->num_to_drop_fk == !ctx->drop_fk); DBUG_ASSERT(!add_fts_doc_id || add_fts_doc_id_idx); diff --git a/storage/innobase/include/handler0alter.h b/storage/innobase/include/handler0alter.h index 1c690839449..b20c59ebf74 100644 --- a/storage/innobase/include/handler0alter.h +++ b/storage/innobase/include/handler0alter.h @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2005, 2016, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 2019, MariaDB Corporation. 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 the Free Software @@ -91,9 +92,13 @@ struct ib_sequence_t { return(m_next_value); } - /** Maximum calumn value if adding an AUTOINC column else 0. Once - we reach the end of the sequence it will be set to ~0. */ - const ulonglong m_max_value; + /** @return maximum column value + @retval 0 if not adding AUTO_INCREMENT column */ + ulonglong max_value() const { return m_max_value; } + +private: + /** Maximum value if adding an AUTO_INCREMENT column, else 0 */ + ulonglong m_max_value; /** Value of auto_increment_increment */ ulong m_increment; |