diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-14 15:10:59 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-07-14 15:10:59 +0300 |
commit | 646a6005e7882f9d4baf516c7936e5ef88ea89a6 (patch) | |
tree | d5b348bec9d756be164dd83fa052b80512f77e2f /storage | |
parent | 6b6c012f330cbbdcdee32333f16813764e5ed466 (diff) | |
parent | 67a03b7c947f5a0cfddbe1acc5e560fc737b0848 (diff) | |
download | mariadb-git-646a6005e7882f9d4baf516c7936e5ef88ea89a6.tar.gz |
Merge 10.1 into 10.2
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innobase/handler/i_s.cc | 28 | ||||
-rw-r--r-- | storage/innobase/include/dict0dict.ic | 8 | ||||
-rw-r--r-- | storage/xtradb/handler/i_s.cc | 30 | ||||
-rw-r--r-- | storage/xtradb/include/dict0dict.ic | 8 | ||||
-rw-r--r-- | storage/xtradb/include/univ.i | 4 |
5 files changed, 45 insertions, 33 deletions
diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index dd38abcb403..1140b8b252a 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -2508,7 +2508,7 @@ i_s_metrics_fill( time_diff = 0; } - /* Unless MONITOR__NO_AVERAGE is marked, we will need + /* Unless MONITOR_NO_AVERAGE is set, we must to calculate the average value. If this is a monitor set owner marked by MONITOR_SET_OWNER, divide the value by another counter (number of calls) designated @@ -2516,8 +2516,9 @@ i_s_metrics_fill( Otherwise average the counter value by the time between the time that the counter is enabled and time it is disabled or time it is sampled. */ - if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE) - && (monitor_info->monitor_type & MONITOR_SET_OWNER) + if ((monitor_info->monitor_type + & (MONITOR_NO_AVERAGE | MONITOR_SET_OWNER)) + == MONITOR_SET_OWNER && monitor_info->monitor_related_id) { mon_type_t value_start = MONITOR_VALUE_SINCE_START( @@ -2533,18 +2534,18 @@ i_s_metrics_fill( fields[METRIC_AVG_VALUE_START]->set_null(); } - if (MONITOR_VALUE(monitor_info->monitor_related_id)) { - OK(fields[METRIC_AVG_VALUE_RESET]->store( - MONITOR_VALUE(count) - / MONITOR_VALUE( - monitor_info->monitor_related_id), - FALSE)); + if (mon_type_t related_value = + MONITOR_VALUE(monitor_info->monitor_related_id)) { + OK(fields[METRIC_AVG_VALUE_RESET] + ->store(MONITOR_VALUE(count) + / related_value, false)); + fields[METRIC_AVG_VALUE_RESET]->set_notnull(); } else { fields[METRIC_AVG_VALUE_RESET]->set_null(); } - } else if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE) - && !(monitor_info->monitor_type - & MONITOR_DISPLAY_CURRENT)) { + } else if (!(monitor_info->monitor_type + & (MONITOR_NO_AVERAGE + | MONITOR_DISPLAY_CURRENT))) { if (time_diff != 0) { OK(fields[METRIC_AVG_VALUE_START]->store( (double) MONITOR_VALUE_SINCE_START( @@ -3326,6 +3327,8 @@ no_fts: conv_str.f_len = sizeof word; conv_str.f_str = word; + rw_lock_s_lock(&cache->lock); + for (ulint i = 0; i < ib_vector_size(cache->indexes); i++) { fts_index_cache_t* index_cache; @@ -3336,6 +3339,7 @@ no_fts: index_cache, thd, &conv_str, tables)); } + rw_lock_s_unlock(&cache->lock); dict_table_close(user_table, FALSE, FALSE); rw_lock_s_unlock(&dict_operation_lock); diff --git a/storage/innobase/include/dict0dict.ic b/storage/innobase/include/dict0dict.ic index bb77bb7e6e6..3b68e113aa5 100644 --- a/storage/innobase/include/dict0dict.ic +++ b/storage/innobase/include/dict0dict.ic @@ -862,16 +862,18 @@ dict_table_x_lock_indexes( /*======================*/ dict_table_t* table) /*!< in: table */ { - dict_index_t* index; - ut_ad(mutex_own(&dict_sys->mutex)); + dict_index_t* clust_index = dict_table_get_first_index(table); + /* Loop through each index of the table and lock them */ - for (index = dict_table_get_first_index(table); + for (dict_index_t* index = dict_table_get_next_index(clust_index); index != NULL; index = dict_table_get_next_index(index)) { rw_lock_x_lock(dict_index_get_lock(index)); } + + rw_lock_x_lock(dict_index_get_lock(clust_index)); } /*********************************************************************//** diff --git a/storage/xtradb/handler/i_s.cc b/storage/xtradb/handler/i_s.cc index 8eb53502da8..9813e993411 100644 --- a/storage/xtradb/handler/i_s.cc +++ b/storage/xtradb/handler/i_s.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2007, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2014, 2019, MariaDB Corporation. +Copyright (c) 2014, 2020, 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 @@ -2553,7 +2553,7 @@ i_s_metrics_fill( time_diff = 0; } - /* Unless MONITOR__NO_AVERAGE is marked, we will need + /* Unless MONITOR_NO_AVERAGE is set, we must to calculate the average value. If this is a monitor set owner marked by MONITOR_SET_OWNER, divide the value by another counter (number of calls) designated @@ -2561,8 +2561,9 @@ i_s_metrics_fill( Otherwise average the counter value by the time between the time that the counter is enabled and time it is disabled or time it is sampled. */ - if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE) - && (monitor_info->monitor_type & MONITOR_SET_OWNER) + if ((monitor_info->monitor_type + & (MONITOR_NO_AVERAGE | MONITOR_SET_OWNER)) + == MONITOR_SET_OWNER && monitor_info->monitor_related_id) { mon_type_t value_start = MONITOR_VALUE_SINCE_START( @@ -2578,18 +2579,18 @@ i_s_metrics_fill( fields[METRIC_AVG_VALUE_START]->set_null(); } - if (MONITOR_VALUE(monitor_info->monitor_related_id)) { - OK(fields[METRIC_AVG_VALUE_RESET]->store( - MONITOR_VALUE(count) - / MONITOR_VALUE( - monitor_info->monitor_related_id), - FALSE)); + if (mon_type_t related_value = + MONITOR_VALUE(monitor_info->monitor_related_id)) { + OK(fields[METRIC_AVG_VALUE_RESET] + ->store(MONITOR_VALUE(count) + / related_value, false)); + fields[METRIC_AVG_VALUE_RESET]->set_notnull(); } else { fields[METRIC_AVG_VALUE_RESET]->set_null(); } - } else if (!(monitor_info->monitor_type & MONITOR_NO_AVERAGE) - && !(monitor_info->monitor_type - & MONITOR_DISPLAY_CURRENT)) { + } else if (!(monitor_info->monitor_type + & (MONITOR_NO_AVERAGE + | MONITOR_DISPLAY_CURRENT))) { if (time_diff) { OK(fields[METRIC_AVG_VALUE_START]->store( (double) MONITOR_VALUE_SINCE_START( @@ -3367,6 +3368,8 @@ no_fts: conv_str.f_len = sizeof word; conv_str.f_str = word; + rw_lock_s_lock(&cache->lock); + for (ulint i = 0; i < ib_vector_size(cache->indexes); i++) { fts_index_cache_t* index_cache; @@ -3377,6 +3380,7 @@ no_fts: index_cache, thd, &conv_str, tables)); } + rw_lock_s_unlock(&cache->lock); dict_table_close(user_table, FALSE, FALSE); rw_lock_s_unlock(&dict_operation_lock); diff --git a/storage/xtradb/include/dict0dict.ic b/storage/xtradb/include/dict0dict.ic index 7256f7f119b..d8df624b5f2 100644 --- a/storage/xtradb/include/dict0dict.ic +++ b/storage/xtradb/include/dict0dict.ic @@ -1026,16 +1026,18 @@ dict_table_x_lock_indexes( /*======================*/ dict_table_t* table) /*!< in: table */ { - dict_index_t* index; - ut_ad(mutex_own(&dict_sys->mutex)); + dict_index_t* clust_index = dict_table_get_first_index(table); + /* Loop through each index of the table and lock them */ - for (index = dict_table_get_first_index(table); + for (dict_index_t* index = dict_table_get_next_index(clust_index); index != NULL; index = dict_table_get_next_index(index)) { rw_lock_x_lock(dict_index_get_lock(index)); } + + rw_lock_x_lock(dict_index_get_lock(clust_index)); } /*********************************************************************//** diff --git a/storage/xtradb/include/univ.i b/storage/xtradb/include/univ.i index 0b7ab3e389e..c0849bf0e2d 100644 --- a/storage/xtradb/include/univ.i +++ b/storage/xtradb/include/univ.i @@ -45,10 +45,10 @@ Created 1/20/1994 Heikki Tuuri #define INNODB_VERSION_MAJOR 5 #define INNODB_VERSION_MINOR 6 -#define INNODB_VERSION_BUGFIX 47 +#define INNODB_VERSION_BUGFIX 48 #ifndef PERCONA_INNODB_VERSION -#define PERCONA_INNODB_VERSION 87.0 +#define PERCONA_INNODB_VERSION 88.0 #endif /* Enable UNIV_LOG_ARCHIVE in XtraDB */ |