From 9b30212f15e280bef6d2a9be212c3295e912b959 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Fri, 13 Nov 2020 18:15:04 +1100 Subject: MDEV-24161: shortcut OQGRAPH dependency checks if disabled Reviewer: Brad Smith --- storage/oqgraph/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'storage') diff --git a/storage/oqgraph/CMakeLists.txt b/storage/oqgraph/CMakeLists.txt index 613a44807c7..3be197f7106 100644 --- a/storage/oqgraph/CMakeLists.txt +++ b/storage/oqgraph/CMakeLists.txt @@ -39,6 +39,10 @@ int main() { return 0; } ENDIF() ENDFUNCTION() +IF(PLUGIN_OQGRAPH STREQUAL "NO") + RETURN() +ENDIF() + IF(NOT DEFINED OQGRAPH_OK) CHECK_OQGRAPH() IF (NOT OQGRAPH_OK) -- cgit v1.2.1 From ceef26cf86689f3dd1db010dc6ca1b065e32e6a4 Mon Sep 17 00:00:00 2001 From: Sergei Petrunia Date: Tue, 17 Nov 2020 15:49:36 +0300 Subject: MyRocks: Bare Windows compatibility: use rmdir built-in, not "rm -rf" --- storage/rocksdb/mysql-test/rocksdb/t/checkpoint.test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage') diff --git a/storage/rocksdb/mysql-test/rocksdb/t/checkpoint.test b/storage/rocksdb/mysql-test/rocksdb/t/checkpoint.test index e5de6246f60..68fe02bbd86 100644 --- a/storage/rocksdb/mysql-test/rocksdb/t/checkpoint.test +++ b/storage/rocksdb/mysql-test/rocksdb/t/checkpoint.test @@ -87,7 +87,7 @@ let $checkpoint = $MYSQL_TMP_DIR/already-existing-directory; --mkdir $checkpoint let $succeeds = 0; --source set_checkpoint.inc ---exec rm -rf $checkpoint +rmdir $checkpoint; --disable_result_log truncate table t1; -- cgit v1.2.1 From ce0cb6a4f660a2bb4d1cf666f73f62977d03a4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 17 Nov 2020 15:07:37 +0200 Subject: MDEV-24188 fixup: Correct the FindBlockX predicate FindBlockX::operator(): Return false if an x-latched block is found. Previously, we were incorrectly returning false if the block was in the log, only if not x-latched. It is unknown if this mistake had any visible impact. Often, we would register both MTR_MEMO_BUF_FIX and MTR_MEMO_PAGE_X_FIX for the same block. --- storage/innobase/mtr/mtr0mtr.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'storage') diff --git a/storage/innobase/mtr/mtr0mtr.cc b/storage/innobase/mtr/mtr0mtr.cc index f966d4c74c6..fefc0687ddb 100644 --- a/storage/innobase/mtr/mtr0mtr.cc +++ b/storage/innobase/mtr/mtr0mtr.cc @@ -804,7 +804,7 @@ mtr_t::release_free_extents(ulint n_reserved) space->release_free_extents(n_reserved); } -/** Find out whether a block was X-latched by the mini-transaction */ +/** Find out whether a block was not X-latched by the mini-transaction */ struct FindBlockX { const buf_block_t █ @@ -814,7 +814,7 @@ struct FindBlockX /** @return whether the block was not found x-latched */ bool operator()(const mtr_memo_slot_t *slot) const { - return slot->object != &block || slot->type == MTR_MEMO_PAGE_X_FIX; + return slot->object != &block || slot->type != MTR_MEMO_PAGE_X_FIX; } }; -- cgit v1.2.1 From 75e7132fca1c4634d4aa8d18d386c55932a5e1b6 Mon Sep 17 00:00:00 2001 From: Alexey Botchkov Date: Mon, 23 Nov 2020 14:12:30 +0400 Subject: MDEV-21842 auto_increment does not increment with compound primary key on partitioned table. The idea of this fix is that it's enough to prevent the next_auto_inc_val from incrementing if an error, to fix this problem and also the MDEV-17333. So this patch basically reverts the existing fix to the MDEV-17333. --- storage/mroonga/ha_mroonga.hpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'storage') diff --git a/storage/mroonga/ha_mroonga.hpp b/storage/mroonga/ha_mroonga.hpp index e1dbb63178e..f2fb2bfe8e7 100644 --- a/storage/mroonga/ha_mroonga.hpp +++ b/storage/mroonga/ha_mroonga.hpp @@ -571,11 +571,6 @@ public: void set_next_insert_id(ulonglong id); void get_auto_increment(ulonglong offset, ulonglong increment, ulonglong nb_desired_values, ulonglong *first_value, ulonglong *nb_reserved_values) mrn_override; - /** Fix spurious -Werror=overloaded-virtual in GCC 9 */ - void restore_auto_increment() mrn_override - { - handler::restore_auto_increment(); - } void restore_auto_increment(ulonglong prev_insert_id) mrn_override; void release_auto_increment() mrn_override; int check_for_upgrade(HA_CHECK_OPT *check_opt) mrn_override; -- cgit v1.2.1 From 1c9833c511b495ed5fee16e9f769f8a458408275 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Wed, 25 Nov 2020 10:54:38 +0200 Subject: Cleanup: row_log_free() The nonnull attribute is not applicable to parameters that are passed by reference, at least not in the Intel compiler. Let us remove the reference indirection, which was only there so that the pointer could be assigned to NULL, and let the callers perform that task. row_log_allocate(): Fix a bug in out-of-memory error handling that would leave a pointer to freed memory. --- storage/innobase/dict/dict0dict.cc | 1 + storage/innobase/handler/handler0alter.cc | 1 + storage/innobase/include/row0log.h | 4 ++-- storage/innobase/include/row0log.ic | 2 ++ storage/innobase/row/row0log.cc | 5 ++--- 5 files changed, 8 insertions(+), 5 deletions(-) (limited to 'storage') diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index 2124fc05faa..6f546dfbd94 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -2215,6 +2215,7 @@ dict_index_remove_from_cache_low( if (index->online_log) { ut_ad(index->online_status == ONLINE_INDEX_CREATION); row_log_free(index->online_log); + index->online_log = NULL; } /* Remove the index from the list of indexes of the table */ diff --git a/storage/innobase/handler/handler0alter.cc b/storage/innobase/handler/handler0alter.cc index b766cac5dd5..f729948b2bf 100644 --- a/storage/innobase/handler/handler0alter.cc +++ b/storage/innobase/handler/handler0alter.cc @@ -6395,6 +6395,7 @@ innobase_online_rebuild_log_free( == ONLINE_INDEX_CREATION); clust_index->online_status = ONLINE_INDEX_COMPLETE; row_log_free(clust_index->online_log); + clust_index->online_log = NULL; DEBUG_SYNC_C("innodb_online_rebuild_log_free_aborted"); } diff --git a/storage/innobase/include/row0log.h b/storage/innobase/include/row0log.h index 383975c32d3..1e46d65e427 100644 --- a/storage/innobase/include/row0log.h +++ b/storage/innobase/include/row0log.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2011, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 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 @@ -65,7 +65,7 @@ Free the row log for an index that was being created online. */ void row_log_free( /*=========*/ - row_log_t*& log) /*!< in,own: row log */ + row_log_t* log) /*!< in,own: row log */ MY_ATTRIBUTE((nonnull)); /******************************************************//** diff --git a/storage/innobase/include/row0log.ic b/storage/innobase/include/row0log.ic index ba7eb7b025c..44d17bbcdf1 100644 --- a/storage/innobase/include/row0log.ic +++ b/storage/innobase/include/row0log.ic @@ -1,6 +1,7 @@ /***************************************************************************** Copyright (c) 2011, 2015, Oracle and/or its affiliates. All Rights Reserved. +Copyright (c) 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 @@ -38,6 +39,7 @@ row_log_abort_sec( ut_ad(!dict_index_is_clust(index)); dict_index_set_online_status(index, ONLINE_INDEX_ABORTED); row_log_free(index->online_log); + index->online_log = NULL; } /******************************************************//** diff --git a/storage/innobase/row/row0log.cc b/storage/innobase/row/row0log.cc index 986cac54540..1a7652350a9 100644 --- a/storage/innobase/row/row0log.cc +++ b/storage/innobase/row/row0log.cc @@ -3001,7 +3001,6 @@ row_log_allocate( log->path = path; dict_index_set_online_status(index, ONLINE_INDEX_CREATION); - index->online_log = log; if (log_tmp_is_encrypted()) { ulint size = srv_sort_buf_size; @@ -3014,6 +3013,7 @@ row_log_allocate( } } + index->online_log = log; /* While we might be holding an exclusive data dictionary lock here, in row_log_abort_sec() we will not always be holding it. Use atomic operations in both cases. */ @@ -3027,7 +3027,7 @@ Free the row log for an index that was being created online. */ void row_log_free( /*=========*/ - row_log_t*& log) /*!< in,own: row log */ + row_log_t* log) /*!< in,own: row log */ { MONITOR_ATOMIC_DEC(MONITOR_ONLINE_CREATE_INDEX); @@ -3046,7 +3046,6 @@ row_log_free( mutex_free(&log->mutex); ut_free(log); - log = NULL; } /******************************************************//** -- cgit v1.2.1 From 5991bd6215054f21ec5c36fc9345ffb50f1b2d04 Mon Sep 17 00:00:00 2001 From: Eugene Kosov Date: Wed, 25 Nov 2020 16:01:38 +0300 Subject: MDEV-24275 InnoDB persistent stats analyze forces full scan forcing lock crash MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a fixup patch for MDEV-23991 afc9d00c66db946c8240fe1fa6b345a3a8b6fec1 We really should read result.n_leaf_pages, which was set previously. Analysis and fix was provided by Jukka Santala. Thanks! Reviewed by: Marko Mäkelä --- storage/innobase/dict/dict0stats.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'storage') diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index f8a4cebfb16..e72a86500a6 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -1985,7 +1985,7 @@ static index_stats_t dict_stats_analyze_index(dict_index_t* index) since it will be faster and will give better results. */ if (root_level == 0 - || N_SAMPLE_PAGES(index) * n_uniq > index->stat_n_leaf_pages) { + || N_SAMPLE_PAGES(index) * n_uniq > result.n_leaf_pages) { if (root_level == 0) { DEBUG_PRINTF(" %s(): just one page," -- cgit v1.2.1 From 73f34336e33e979942a6eb38bdbc7d34ff092d85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 1 Dec 2020 15:24:49 +0200 Subject: MDEV-24323 Crash on recovery after kill during instant ADD COLUMN row_undo_ins_parse_undo_rec(): Do not try to read non-existing virtual column information for the metadata record. --- storage/innobase/row/row0uins.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'storage') diff --git a/storage/innobase/row/row0uins.cc b/storage/innobase/row/row0uins.cc index 7da9902995c..f72ad28e70e 100644 --- a/storage/innobase/row/row0uins.cc +++ b/storage/innobase/row/row0uins.cc @@ -459,6 +459,13 @@ close_table: node->heap); } else { node->ref = &trx_undo_metadata; + if (!row_undo_search_clust_to_pcur(node)) { + /* An error probably occurred during + an insert into the clustered index, + after we wrote the undo log record. */ + goto close_table; + } + return; } if (!row_undo_search_clust_to_pcur(node)) { -- cgit v1.2.1