From a1b6128dedb4419db9fadaf94c356d3477d4e06f Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Mon, 22 May 2017 18:27:44 +0000 Subject: [PATCH 01/17] MDEV-11264 Fix DeviceIoControl() usage in innodb. As documented in MSDN, DeviceIoControl() needs valid (not NULL) OVERLAPPED parameter, for files opened with for OVERLAPPED access. --- storage/xtradb/os/os0file.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/storage/xtradb/os/os0file.cc b/storage/xtradb/os/os0file.cc index 34336a4bb7d..20b202506f5 100644 --- a/storage/xtradb/os/os0file.cc +++ b/storage/xtradb/os/os0file.cc @@ -6423,22 +6423,27 @@ os_file_trim( flt.Ranges[0].Offset = off; flt.Ranges[0].Length = trim_len; + OVERLAPPED overlapped = { 0 }; + overlapped.hEvent = win_get_syncio_event(); BOOL ret = DeviceIoControl(slot->file, FSCTL_FILE_LEVEL_TRIM, - &flt, sizeof(flt), NULL, NULL, NULL, NULL); - + &flt, sizeof(flt), NULL, NULL, NULL, &overlapped); + DWORD tmp; + if (ret) { + ret = GetOverlappedResult(slot->file, &overlapped, &tmp, FALSE); + } + else if (GetLastError() == ERROR_IO_PENDING) { + ret = GetOverlappedResult(slot->file, &overlapped, &tmp, TRUE); + } if (!ret) { + DWORD last_error = GetLastError(); /* After first failure do not try to trim again */ os_fallocate_failed = true; srv_use_trim = FALSE; ut_print_timestamp(stderr); - fprintf(stderr, - " InnoDB: Warning: fallocate call failed with error.\n" - " InnoDB: start: %lu len: %lu payload: %lu\n" - " InnoDB: Disabling fallocate for now.\n", off, trim_len, len); - os_file_handle_error_no_exit(slot->name, - " DeviceIOControl(FSCTL_FILE_LEVEL_TRIM) ", - FALSE, __FILE__, __LINE__); + fprintf(stderr, + " InnoDB: Warning: DeviceIoControl(FSCTL_FILE_LEVEL_TRIM) call failed with error %u%s. Disabling trimming.\n", + last_error, last_error == ERROR_NOT_SUPPORTED ? "(ERROR_NOT_SUPPORTED)" : ""); if (slot->write_size) { *slot->write_size = 0; From 70630e3c92f72f39666dedaa7733cb0c22e66d62 Mon Sep 17 00:00:00 2001 From: Vladislav Vaintroub Date: Fri, 19 May 2017 15:55:35 +0000 Subject: [PATCH 02/17] Workaround dependency problems (constant rebuilds) in Visual Studio generator --- sql/CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt index 2e581b1acbe..ca2b059eeef 100644 --- a/sql/CMakeLists.txt +++ b/sql/CMakeLists.txt @@ -38,15 +38,22 @@ SET_SOURCE_FILES_PROPERTIES(${GEN_SOURCES} # Gen_lex_token # Make sure sql_yacc.h is generated before compiling gen_lex_token + +IF(NOT CMAKE_GENERATOR MATCHES "Visual Studio") + SET(DEPENDS_gen_lex_token DEPENDS gen_lex_token) + SET(DEPENDS_gen_lex_hash DEPENDS gen_lex_hash) +ENDIF() + + IF(NOT CMAKE_CROSSCOMPILING) - ADD_EXECUTABLE(gen_lex_token gen_lex_token.cc) - ADD_DEPENDENCIES(gen_lex_token GenServerSource) + ADD_EXECUTABLE(gen_lex_token gen_lex_token.cc + ${CMAKE_CURRENT_BINARY_DIR}/sql_yacc.h) ENDIF() ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_token.h COMMAND gen_lex_token > lex_token.h - DEPENDS gen_lex_token + ${DEPENDS_gen_lex_token} ) ADD_DEFINITIONS(-DMYSQL_SERVER -DHAVE_EVENT_SCHEDULER) @@ -295,7 +302,7 @@ ENDIF() ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lex_hash.h COMMAND gen_lex_hash > lex_hash.h - DEPENDS gen_lex_hash + ${DEPENDS_gen_lex_hash} ) MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc COMPONENT Server) From fde86fc1ed399d17b233f033db69f2b973fb6d06 Mon Sep 17 00:00:00 2001 From: Daniel Bartholomew Date: Tue, 23 May 2017 09:21:28 -0400 Subject: [PATCH 03/17] bump the VERSION --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 22d7ed0a903..ab62b5a1c7c 100644 --- a/VERSION +++ b/VERSION @@ -1,3 +1,3 @@ MYSQL_VERSION_MAJOR=10 MYSQL_VERSION_MINOR=0 -MYSQL_VERSION_PATCH=31 +MYSQL_VERSION_PATCH=32 From 7e0f40b33342135ed3e203314696dd75c1558be0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 23 May 2017 18:37:55 +0300 Subject: [PATCH 04/17] =?UTF-8?q?MDEV-12625=20total=5Findex=5Fblocks=20is?= =?UTF-8?q?=20uninitialized=20in=20ALTER=20TABLE=E2=80=A6ALGORITHM=3DINPLA?= =?UTF-8?q?CE=20of=20small=20tables?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before MDEV-6812, it did not matter that merge_files[].offset was uninitialized when no files were created. This problem was introduced in MDEV-6812. There could be a user-visible impact that the progress reports spit into the error log are bogus. row_merge_build_indexes(): Initialize merge_files[i].offset. --- storage/innobase/row/row0merge.cc | 1 + storage/xtradb/row/row0merge.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 9cd79bdd523..85e053de961 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -4035,6 +4035,7 @@ row_merge_build_indexes( for (i = 0; i < n_indexes; i++) { merge_files[i].fd = -1; + merge_files[i].offset = 0; } total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX; diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 42033983cfa..16348f3c8dd 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -4037,6 +4037,7 @@ row_merge_build_indexes( for (i = 0; i < n_indexes; i++) { merge_files[i].fd = -1; + merge_files[i].offset = 0; } total_static_cost = COST_BUILD_INDEX_STATIC * n_indexes + COST_READ_CLUSTERED_INDEX; From 54caaf684801c332a7130d478023aa7706a69aa1 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 20 May 2017 12:32:10 +0200 Subject: [PATCH 05/17] MDEV-10940 plugins.pam still fails in buildbot with valgrind fixed valgrind warning in a debug output --- plugin/auth_pam/auth_pam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c index 95d95b9719c..ffc3d6f5537 100644 --- a/plugin/auth_pam/auth_pam.c +++ b/plugin/auth_pam/auth_pam.c @@ -166,7 +166,7 @@ static int pam_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info) end: pam_end(pamh, status); - PAM_DEBUG((stderr, "PAM: status = %d user = %s\n", status, new_username)); + PAM_DEBUG((stderr, "PAM: status = %d user = %s\n", status, info->authenticated_as)); return status == PAM_SUCCESS ? CR_OK : CR_ERROR; } From fdc1fd6f49b43d1226785e71b3a2c851ac3bfb47 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 20 May 2017 14:04:03 +0200 Subject: [PATCH 06/17] MDEV-11311 Create federated table does not work as expected. FederatedX wasn't discovering prefix keys correctly. Of course, as it had the HA_NO_PREFIX_CHAR_KEYS table_flag set... --- .../suite/federated/assisted_discovery.result | 32 +++++++++++++++++++ .../suite/federated/assisted_discovery.test | 24 ++++++++++++++ storage/federatedx/ha_federatedx.h | 2 +- 3 files changed, 57 insertions(+), 1 deletion(-) diff --git a/mysql-test/suite/federated/assisted_discovery.result b/mysql-test/suite/federated/assisted_discovery.result index 7a351b9df6f..5ad37397b3c 100644 --- a/mysql-test/suite/federated/assisted_discovery.result +++ b/mysql-test/suite/federated/assisted_discovery.result @@ -31,6 +31,38 @@ id group a\\b a\\ name 1 1 2 NULL foo 2 1 2 NULL fee DROP TABLE t1; +create table t1 ( +a bigint(20) not null auto_increment, +b bigint(20) not null, +c tinyint(4) not null, +d varchar(4096) not null, +primary key (a), +key (b,c,d(255)) +); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL AUTO_INCREMENT, + `b` bigint(20) NOT NULL, + `c` tinyint(4) NOT NULL, + `d` varchar(4096) NOT NULL, + PRIMARY KEY (`a`), + KEY `b` (`b`,`c`,`d`(255)) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +create table t1 engine=federated +connection='mysql://root@127.0.0.1:SLAVE_PORT/test/t1'; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` bigint(20) NOT NULL AUTO_INCREMENT, + `b` bigint(20) NOT NULL, + `c` tinyint(4) NOT NULL, + `d` varchar(4096) NOT NULL, + PRIMARY KEY (`a`), + KEY `b` (`b`,`c`,`d`(255)) +) ENGINE=FEDERATED DEFAULT CHARSET=latin1 CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1' +drop table t1; +drop table t1; DROP TABLE IF EXISTS federated.t1; DROP DATABASE IF EXISTS federated; DROP TABLE IF EXISTS federated.t1; diff --git a/mysql-test/suite/federated/assisted_discovery.test b/mysql-test/suite/federated/assisted_discovery.test index 9f3abe74ecc..fa83a2a8e19 100644 --- a/mysql-test/suite/federated/assisted_discovery.test +++ b/mysql-test/suite/federated/assisted_discovery.test @@ -30,5 +30,29 @@ connection slave; SELECT * FROM t1; DROP TABLE t1; +# +# +# +create table t1 ( + a bigint(20) not null auto_increment, + b bigint(20) not null, + c tinyint(4) not null, + d varchar(4096) not null, + primary key (a), + key (b,c,d(255)) +); +show create table t1; + +connection master; +--replace_result $SLAVE_MYPORT SLAVE_PORT +eval create table t1 engine=federated + connection='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1'; +--replace_result $SLAVE_MYPORT SLAVE_PORT +show create table t1; +drop table t1; + +connection slave; +drop table t1; + source include/federated_cleanup.inc; diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 2c2c6eef26b..f8531014ee4 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -330,7 +330,7 @@ public: return (HA_PRIMARY_KEY_IN_READ_INDEX | HA_FILE_BASED | HA_REC_NOT_IN_SEQ | HA_AUTO_PART_KEY | HA_CAN_INDEX_BLOBS | HA_BINLOG_ROW_CAPABLE | HA_BINLOG_STMT_CAPABLE | HA_CAN_REPAIR | - HA_NO_PREFIX_CHAR_KEYS | HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | + HA_PRIMARY_KEY_REQUIRED_FOR_DELETE | HA_PARTIAL_COLUMN_READ | HA_NULL_IN_KEY); } /* From 152aec019df9399afb72aa720b23c3bba0ac2bbe Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 21 May 2017 13:19:38 +0200 Subject: [PATCH 07/17] MDEV-11650 plugins.cracklib_password_check, plugins.two_password_validations fail in buildbot with valgrind (Conditional jump or move depends on uninitialised value) --- plugin/cracklib_password_check/cracklib_password_check.c | 1 + 1 file changed, 1 insertion(+) diff --git a/plugin/cracklib_password_check/cracklib_password_check.c b/plugin/cracklib_password_check/cracklib_password_check.c index 7861d5fd83e..94587a6d659 100644 --- a/plugin/cracklib_password_check/cracklib_password_check.c +++ b/plugin/cracklib_password_check/cracklib_password_check.c @@ -30,6 +30,7 @@ static int crackme(MYSQL_LEX_STRING *username, MYSQL_LEX_STRING *password) const char *res; memcpy(user, username->str, username->length); + user[username->length]= 0; if ((host= strchr(user, '@'))) *host++= 0; From 7e0c8fc3fb284a38a4640ffaa2ddbfb282240832 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 21 May 2017 16:21:15 +0200 Subject: [PATCH 08/17] MDEV-12389 ADD CHECK leaves an orphaned .par file --- mysql-test/r/partition_alter.result | 41 +++++++++++++++++++++++++++++ mysql-test/t/partition_alter.test | 39 +++++++++++++++++++++++++++ sql/sql_table.cc | 4 ++- 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/mysql-test/r/partition_alter.result b/mysql-test/r/partition_alter.result index cbd90b5ba7c..4aea0045617 100644 --- a/mysql-test/r/partition_alter.result +++ b/mysql-test/r/partition_alter.result @@ -51,3 +51,44 @@ execute stmt; execute stmt; deallocate prepare stmt; drop table test_data; +create table t1(id int, d date not null, b bool not null default 0, primary key(id,d)) +engine=innodb +partition by range columns (d) ( +partition p1 values less than ('2016-10-18'), +partition p2 values less than ('2020-10-19')); +insert t1 values (0, '2000-01-02', 0); +insert t1 values (1, '2020-01-02', 10); +alter table t1 add check (b in (0, 1)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `d` date NOT NULL, + `b` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`d`) +) ENGINE=InnoDB DEFAULT CHARSET=latin1 +/*!50500 PARTITION BY RANGE COLUMNS(d) +(PARTITION p1 VALUES LESS THAN ('2016-10-18') ENGINE = InnoDB, + PARTITION p2 VALUES LESS THAN ('2020-10-19') ENGINE = InnoDB) */ +insert t1 values (2, '2020-01-03', 20); +drop table t1; +create table t1(id int, d date not null, b bool not null default 0, primary key(id,d)) +partition by range columns (d) ( +partition p1 values less than ('2016-10-18'), +partition p2 values less than ('2020-10-19')); +insert t1 values (0, '2000-01-02', 0); +insert t1 values (1, '2020-01-02', 10); +alter table t1 add check (b in (0, 1)); +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `id` int(11) NOT NULL, + `d` date NOT NULL, + `b` tinyint(1) NOT NULL DEFAULT '0', + PRIMARY KEY (`id`,`d`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +/*!50500 PARTITION BY RANGE COLUMNS(d) +(PARTITION p1 VALUES LESS THAN ('2016-10-18') ENGINE = MyISAM, + PARTITION p2 VALUES LESS THAN ('2020-10-19') ENGINE = MyISAM) */ +insert t1 values (2, '2020-01-03', 20); +drop table t1; diff --git a/mysql-test/t/partition_alter.test b/mysql-test/t/partition_alter.test index 592d8fdaeaa..2f3c2a319fb 100644 --- a/mysql-test/t/partition_alter.test +++ b/mysql-test/t/partition_alter.test @@ -1,3 +1,4 @@ +--source include/have_innodb.inc --source include/have_partition.inc CREATE TABLE `test_data` ( @@ -64,3 +65,41 @@ deallocate prepare stmt; drop table test_data; +# +# MDEV-12389 ADD CHECK leaves an orphaned .par file +# + +--let $datadir=`SELECT @@datadir` + +# InnoDB +create table t1(id int, d date not null, b bool not null default 0, primary key(id,d)) +engine=innodb +partition by range columns (d) ( +partition p1 values less than ('2016-10-18'), +partition p2 values less than ('2020-10-19')); +insert t1 values (0, '2000-01-02', 0); +insert t1 values (1, '2020-01-02', 10); +# should fail in 10.2 +alter table t1 add check (b in (0, 1)); +# should have CHECK in 10.2 +show create table t1; +# should fail in 10.2 +insert t1 values (2, '2020-01-03', 20); +drop table t1; +--list_files $datadir/test + +# MyISAM, different execution path +create table t1(id int, d date not null, b bool not null default 0, primary key(id,d)) +partition by range columns (d) ( +partition p1 values less than ('2016-10-18'), +partition p2 values less than ('2020-10-19')); +insert t1 values (0, '2000-01-02', 0); +insert t1 values (1, '2020-01-02', 10); +# should fail in 10.2 +alter table t1 add check (b in (0, 1)); +# should have CHECK in 10.2 +show create table t1; +# should fail in 10.2 +insert t1 values (2, '2020-01-03', 20); +drop table t1; +--list_files $datadir/test diff --git a/sql/sql_table.cc b/sql/sql_table.cc index 57fa732251f..db0d6d4f377 100644 --- a/sql/sql_table.cc +++ b/sql/sql_table.cc @@ -8856,7 +8856,9 @@ bool mysql_alter_table(THD *thd,char *new_db, char *new_name, TODO don't create the frm in the first place */ - deletefrm(alter_ctx.get_tmp_path()); + const char *path= alter_ctx.get_tmp_path(); + table->file->ha_create_partitioning_metadata(path, NULL, CHF_DELETE_FLAG); + deletefrm(path); my_free(const_cast(frm.str)); goto end_inplace; } From ad807aebdea8ca43c4c642505840c6b8da1c7114 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sun, 21 May 2017 18:10:33 +0200 Subject: [PATCH 09/17] MDEV-12612 mysqladmin --local flush... to use FLUSH LOCAL Make `mysqladmin --local` use `FLUSH LOCAL` for all flush-* commands, and only do `SET SQL_LOG_BIN=OFF` for create/drop/old_password/password. Additionally, --local is ignored for all commands that never write to binlog, so e.g. `mysqladmin --local version` no longer needs SUPER --- client/mysqladmin.cc | 85 +++++++++++++-------- mysql-test/suite/binlog/r/mysqladmin.result | 12 +++ mysql-test/suite/binlog/t/mysqladmin.test | 12 +++ 3 files changed, 76 insertions(+), 33 deletions(-) create mode 100644 mysql-test/suite/binlog/r/mysqladmin.result create mode 100644 mysql-test/suite/binlog/t/mysqladmin.test diff --git a/client/mysqladmin.cc b/client/mysqladmin.cc index e6b904eb26e..ffdc73f99ad 100644 --- a/client/mysqladmin.cc +++ b/client/mysqladmin.cc @@ -46,6 +46,7 @@ static uint opt_count_iterations= 0, my_end_arg; static ulong opt_connect_timeout, opt_shutdown_timeout; static char * unix_port=0; static char *opt_plugin_dir= 0, *opt_default_auth= 0; +static bool sql_log_bin_off= false; #ifdef HAVE_SMEM static char *shared_memory_base_name=0; @@ -598,6 +599,31 @@ static my_bool sql_connect(MYSQL *mysql, uint wait) } +static int maybe_disable_binlog(MYSQL *mysql) +{ + if (opt_local && !sql_log_bin_off) + { + if (mysql_query(mysql, "set local sql_log_bin=0")) + { + my_printf_error(0, "SET LOCAL SQL_LOG_BIN=0 failed; error: '%-.200s'", + error_flags, mysql_error(mysql)); + return -1; + } + } + sql_log_bin_off= true; + return 0; +} + + +int flush(MYSQL *mysql, const char *what) +{ + char buf[FN_REFLEN]; + my_snprintf(buf, sizeof(buf), "flush %s%s", + (opt_local && !sql_log_bin_off ? "local " : ""), what); + return mysql_query(mysql, buf); +} + + /** @brief Execute all commands @@ -627,17 +653,6 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) struct my_rnd_struct rand_st; char buff[FN_REFLEN + 20]; - if (opt_local) - { - sprintf(buff, "set local sql_log_bin=0"); - if (mysql_query(mysql, buff)) - { - my_printf_error(0, "SET LOCAL SQL_LOG_BIN=0 failed; error: '%-.200s'", - error_flags, mysql_error(mysql)); - return -1; - } - } - for (; argc > 0 ; argv++,argc--) { int command; @@ -649,6 +664,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) my_printf_error(0, "Too few arguments to create", error_flags); return 1; } + if (maybe_disable_binlog(mysql)) + return -1; sprintf(buff,"create database `%.*s`",FN_REFLEN,argv[1]); if (mysql_query(mysql,buff)) { @@ -666,6 +683,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) my_printf_error(0, "Too few arguments to drop", error_flags); return 1; } + if (maybe_disable_binlog(mysql)) + return -1; if (drop_db(mysql,argv[1])) return -1; argc--; argv++; @@ -706,7 +725,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_PRIVILEGES: case ADMIN_RELOAD: - if (mysql_query(mysql,"flush privileges")) + if (flush(mysql, "privileges")) { my_printf_error(0, "reload failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -910,7 +929,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_LOGS: { - if (mysql_query(mysql,"flush logs")) + if (flush(mysql, "logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -920,7 +939,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_BINARY_LOG: { - if (mysql_query(mysql, "flush binary logs")) + if (flush(mysql, "binary logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -930,7 +949,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_ENGINE_LOG: { - if (mysql_query(mysql,"flush engine logs")) + if (flush(mysql, "engine logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -940,7 +959,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_ERROR_LOG: { - if (mysql_query(mysql, "flush error logs")) + if (flush(mysql, "error logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -950,7 +969,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_GENERAL_LOG: { - if (mysql_query(mysql, "flush general logs")) + if (flush(mysql, "general logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -960,7 +979,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_RELAY_LOG: { - if (mysql_query(mysql, "flush relay logs")) + if (flush(mysql, "relay logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -970,7 +989,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_SLOW_LOG: { - if (mysql_query(mysql,"flush slow logs")) + if (flush(mysql, "slow logs")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -980,7 +999,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_HOSTS: { - if (mysql_query(mysql,"flush hosts")) + if (flush(mysql, "hosts")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -990,7 +1009,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_TABLES: { - if (mysql_query(mysql,"flush tables")) + if (flush(mysql, "tables")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1000,7 +1019,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_STATUS: { - if (mysql_query(mysql,"flush status")) + if (flush(mysql, "status")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1010,7 +1029,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_TABLE_STATISTICS: { - if (mysql_query(mysql,"flush table_statistics")) + if (flush(mysql, "table_statistics")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1020,7 +1039,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_INDEX_STATISTICS: { - if (mysql_query(mysql,"flush index_statistics")) + if (flush(mysql, "index_statistics")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1030,7 +1049,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_USER_STATISTICS: { - if (mysql_query(mysql,"flush user_statistics")) + if (flush(mysql, "user_statistics")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1040,7 +1059,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_USER_RESOURCES: { - if (mysql_query(mysql, "flush user_resources")) + if (flush(mysql, "user_resources")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1050,7 +1069,7 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_CLIENT_STATISTICS: { - if (mysql_query(mysql,"flush client_statistics")) + if (flush(mysql, "client_statistics")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1060,9 +1079,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_ALL_STATISTICS: { - if (mysql_query(mysql, - "flush table_statistics,index_statistics," - "user_statistics,client_statistics")) + if (flush(mysql, "table_statistics,index_statistics," + "user_statistics,client_statistics")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1072,9 +1090,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) } case ADMIN_FLUSH_ALL_STATUS: { - if (mysql_query(mysql, - "flush status,table_statistics,index_statistics," - "user_statistics,client_statistics")) + if (flush(mysql, "status,table_statistics,index_statistics," + "user_statistics,client_statistics")) { my_printf_error(0, "flush failed; error: '%s'", error_flags, mysql_error(mysql)); @@ -1092,6 +1109,8 @@ static int execute_commands(MYSQL *mysql,int argc, char **argv) start_time=time((time_t*) 0); my_rnd_init(&rand_st,(ulong) start_time,(ulong) start_time/2); + if (maybe_disable_binlog(mysql)) + return -1; if (argc < 1) { my_printf_error(0, "Too few arguments to change password", error_flags); diff --git a/mysql-test/suite/binlog/r/mysqladmin.result b/mysql-test/suite/binlog/r/mysqladmin.result new file mode 100644 index 00000000000..4be6c96d55b --- /dev/null +++ b/mysql-test/suite/binlog/r/mysqladmin.result @@ -0,0 +1,12 @@ +create user adm@localhost identified by 'foobar'; +grant reload on *.* to adm@localhost; +reset master; +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # flush status +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # flush status +drop user adm@localhost; diff --git a/mysql-test/suite/binlog/t/mysqladmin.test b/mysql-test/suite/binlog/t/mysqladmin.test new file mode 100644 index 00000000000..3c2fbc0a708 --- /dev/null +++ b/mysql-test/suite/binlog/t/mysqladmin.test @@ -0,0 +1,12 @@ +source include/have_binlog_format_statement.inc; +# +# MDEV-12612 mysqladmin --local flush... to use FLUSH LOCAL +# +create user adm@localhost identified by 'foobar'; +grant reload on *.* to adm@localhost; +reset master; +exec $MYSQLADMIN -uadm -pfoobar flush-status; +source include/show_binlog_events.inc; +exec $MYSQLADMIN --local -uadm -pfoobar flush-status; +source include/show_binlog_events.inc; +drop user adm@localhost; From ae76ff45245d16212854e1b2c7e3e53c9dce9073 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 22 May 2017 09:34:39 +0200 Subject: [PATCH 10/17] compiler warning on Win64 cast pointer(64)->long(32) --- sql/sql_class.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_class.h b/sql/sql_class.h index 9ae1e5cf23b..db1214ab26b 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -4283,7 +4283,7 @@ public: select_result(thd_arg), suppress_my_ok(false) { DBUG_ENTER("select_result_interceptor::select_result_interceptor"); - DBUG_PRINT("enter", ("this 0x%lx", (ulong) this)); + DBUG_PRINT("enter", ("this %p", this)); DBUG_VOID_RETURN; } /* Remove gcc warning */ uint field_count(List &fields) const { return 0; } From c65dd3668ba7146afdd1c0222555508c1b4aeecb Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Mon, 22 May 2017 11:02:15 +0200 Subject: [PATCH 11/17] de-obfuscate sys_vars.delay_key_write_func test Test fails, because of a bug: global delay_key_write is cached in the THD and the cached value becomes out-of-date when the global value changes. This is fixed in MDEV-11335 --- .../sys_vars/r/delay_key_write_func.result | 39 ++++++++++------ .../sys_vars/t/delay_key_write_func.test | 46 +------------------ 2 files changed, 26 insertions(+), 59 deletions(-) diff --git a/mysql-test/suite/sys_vars/r/delay_key_write_func.result b/mysql-test/suite/sys_vars/r/delay_key_write_func.result index d55cca7ab8e..5cc4b2eaaad 100644 --- a/mysql-test/suite/sys_vars/r/delay_key_write_func.result +++ b/mysql-test/suite/sys_vars/r/delay_key_write_func.result @@ -1,23 +1,20 @@ '#--------------------FN_DYNVARS_023_01-------------------------#' SET @start_value= @@global.delay_key_write; -SET @@global.delay_key_write = ON; -SELECT @@global.delay_key_write; -@@global.delay_key_write -ON -'connect (user1,localhost,root,,,,)' -'connection user1' -SELECT @@global.delay_key_write AS res_is_ON; -res_is_ON -ON -SET @@global.delay_key_write = ALL; -'connect (user1,localhost,root,,,,)' -'connection user1' -SELECT @@global.delay_key_write AS res_is_ALL; -res_is_ALL -ALL '#--------------------FN_DYNVARS_023_02-------------------------#' +CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) +BEGIN +WHILE (var1 < var2) DO +INSERT INTO t1 VALUES(var1,REPEAT('MYSQL',10),100000.0/var1); +SET var1=var1+1; +END WHILE; +END// '---check when delay_key_write is OFF---' SET @@global.delay_key_write = OFF; +CREATE TABLE t1( +a INT PRIMARY KEY, +b VARCHAR(512), +c DOUBLE +) DELAY_KEY_WRITE = 1; FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; @@ -32,8 +29,14 @@ Key_write_requests 9 SELECT COUNT(*) FROM t1; COUNT(*) 9 +DROP TABLE t1; '----check when delay_key_write is ON---' SET @@global.delay_key_write = ON; +CREATE TABLE t1( +a INT PRIMARY KEY, +b VARCHAR(512), +c DOUBLE +) DELAY_KEY_WRITE = 1; FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; @@ -48,8 +51,14 @@ Key_write_requests 9 SELECT COUNT(*) FROM t1; COUNT(*) 9 +DROP TABLE t1; '----check when delay_key_write is ALL---' SET @@global.delay_key_write = ALL; +CREATE TABLE t1( +a INT PRIMARY KEY, +b VARCHAR(512), +c DOUBLE +) DELAY_KEY_WRITE = 0; FLUSH STATUS; CALL sp_addRecords(1,10); SHOW STATUS LIKE 'Key_reads'; diff --git a/mysql-test/suite/sys_vars/t/delay_key_write_func.test b/mysql-test/suite/sys_vars/t/delay_key_write_func.test index a44b37653d2..e823e51954c 100644 --- a/mysql-test/suite/sys_vars/t/delay_key_write_func.test +++ b/mysql-test/suite/sys_vars/t/delay_key_write_func.test @@ -20,36 +20,14 @@ ############################################################################### --echo '#--------------------FN_DYNVARS_023_01-------------------------#' -####################################################################### -# Check if setting delay_key_write is changed in every new connection # -####################################################################### - SET @start_value= @@global.delay_key_write; -SET @@global.delay_key_write = ON; -SELECT @@global.delay_key_write; - ---echo 'connect (user1,localhost,root,,,,)' -connect (user1,localhost,root,,,,); ---echo 'connection user1' -connection user1; -SELECT @@global.delay_key_write AS res_is_ON; -SET @@global.delay_key_write = ALL; -disconnect user1; - ---echo 'connect (user1,localhost,root,,,,)' -connect (user1,localhost,root,,,,); ---echo 'connection user1' -connection user1; -SELECT @@global.delay_key_write AS res_is_ALL; - --echo '#--------------------FN_DYNVARS_023_02-------------------------#' ###################################################### # Begin the functionality Testing of delay_key_write # ###################################################### # create procedure to add rows ---disable_query_log DELIMITER //; CREATE PROCEDURE sp_addRecords (IN var1 INT,IN var2 INT) BEGIN @@ -59,28 +37,19 @@ BEGIN END WHILE; END// DELIMITER ;// ---enable_query_log #============================================================================== --echo '---check when delay_key_write is OFF---' #============================================================================== - SET @@global.delay_key_write = OFF; - ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings # create a table with delay_key_write enabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 1; ---enable_query_log - FLUSH STATUS; @@ -90,6 +59,7 @@ SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; +DROP TABLE t1; #============================================================================== --echo '----check when delay_key_write is ON---' @@ -97,17 +67,12 @@ SELECT COUNT(*) FROM t1; SET @@global.delay_key_write = ON; ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings # create a table with delay_key_write enabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 1; ---enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); @@ -116,23 +81,19 @@ SHOW STATUS LIKE 'Key_reads'; SHOW STATUS LIKE 'Key_writes'; SHOW STATUS LIKE 'Key_write_requests'; SELECT COUNT(*) FROM t1; +DROP TABLE t1; #============================================================================== --echo '----check when delay_key_write is ALL---' #============================================================================== SET @@global.delay_key_write = ALL; ---disable_query_log ---disable_warnings -DROP TABLE IF EXISTS t1; ---enable_warnings # create a table with delay_key_write disabled CREATE TABLE t1( a INT PRIMARY KEY, b VARCHAR(512), c DOUBLE ) DELAY_KEY_WRITE = 0; ---enable_query_log FLUSH STATUS; CALL sp_addRecords(1,10); @@ -144,12 +105,9 @@ SELECT COUNT(*) FROM t1; DROP PROCEDURE sp_addRecords; DROP TABLE t1; -disconnect user1; -connection default; SET @@global.delay_key_write= @start_value; #################################################### # End of functionality testing for delay_key_write # #################################################### - From fc89f5fd40d7be54f1d4f7017a8f46f3be9fa902 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Sat, 20 May 2017 19:14:06 +0200 Subject: [PATCH 12/17] MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows Don't rebuild the table for ALTER TABLE delay_key_write changes. After that, delay_key_write value in .frm may differ from the value in .MYI. We'll do what .frm says. --- mysql-test/r/alter_table_online.result | 35 +++++++++++++++++++++++--- mysql-test/t/alter_table_online.test | 24 +++++++++++++++--- storage/myisam/ha_myisam.cc | 10 +++++--- 3 files changed, 59 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/alter_table_online.result b/mysql-test/r/alter_table_online.result index e3f285437a7..4c338a1ebe6 100644 --- a/mysql-test/r/alter_table_online.result +++ b/mysql-test/r/alter_table_online.result @@ -184,6 +184,35 @@ CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci); ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE; ERROR 0A000: ALGORITHM=INPLACE is not supported for this operation. Try ALGORITHM=COPY. DROP TABLE t1; -# -# End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB -# +select @@global.delay_key_write; +@@global.delay_key_write +ON +create table t1 (a int, b int, key(b)); +flush tables; +flush status; +show status like 'Feature_delay_key_write'; +Variable_name Value +Feature_delay_key_write 0 +insert t1 values (1,2),(2,3),(3,4); +show status like 'Feature_delay_key_write'; +Variable_name Value +Feature_delay_key_write 0 +alter online table t1 delay_key_write=1; +show status like 'Feature_delay_key_write'; +Variable_name Value +Feature_delay_key_write 1 +flush tables; +insert t1 values (1,2),(2,3),(3,4); +show status like 'Feature_delay_key_write'; +Variable_name Value +Feature_delay_key_write 2 +alter online table t1 delay_key_write=0; +show status like 'Feature_delay_key_write'; +Variable_name Value +Feature_delay_key_write 2 +flush tables; +insert t1 values (1,2),(2,3),(3,4); +show status like 'Feature_delay_key_write'; +Variable_name Value +Feature_delay_key_write 2 +drop table t1; diff --git a/mysql-test/t/alter_table_online.test b/mysql-test/t/alter_table_online.test index 22ebadd64f9..15df36e8009 100644 --- a/mysql-test/t/alter_table_online.test +++ b/mysql-test/t/alter_table_online.test @@ -285,6 +285,24 @@ CREATE TABLE t1 (a LONGTEXT COLLATE latin1_general_ci); ALTER TABLE t1 MODIFY a LONGTEXT COLLATE latin1_swedish_ci, ALGORITHM=INPLACE; DROP TABLE t1; ---echo # ---echo # End of MDEV-8948 ALTER ... INPLACE does work for BINARY, BLOB ---echo # +# +# MDEV-11335 Changing delay_key_write option for MyISAM table should not copy rows +# +select @@global.delay_key_write; +create table t1 (a int, b int, key(b)); +flush tables; +flush status; +show status like 'Feature_delay_key_write'; +insert t1 values (1,2),(2,3),(3,4); +show status like 'Feature_delay_key_write'; +alter online table t1 delay_key_write=1; +show status like 'Feature_delay_key_write'; +flush tables; +insert t1 values (1,2),(2,3),(3,4); +show status like 'Feature_delay_key_write'; +alter online table t1 delay_key_write=0; +show status like 'Feature_delay_key_write'; +flush tables; +insert t1 values (1,2),(2,3),(3,4); +show status like 'Feature_delay_key_write'; +drop table t1; diff --git a/storage/myisam/ha_myisam.cc b/storage/myisam/ha_myisam.cc index 4427db79da1..b335d360379 100644 --- a/storage/myisam/ha_myisam.cc +++ b/storage/myisam/ha_myisam.cc @@ -825,6 +825,10 @@ int ha_myisam::open(const char *name, int mode, uint test_if_locked) /* Count statistics of usage for newly open normal files */ if (file->s->reopen == 1 && ! (test_if_locked & HA_OPEN_TMP_TABLE)) { + /* use delay_key_write from .frm, not .MYI */ + file->s->delay_key_write= delay_key_write_options == DELAY_KEY_WRITE_ALL || + (delay_key_write_options == DELAY_KEY_WRITE_ON && + table->s->db_create_options & HA_OPTION_DELAY_KEY_WRITE); if (file->s->delay_key_write) feature_files_opened_with_delayed_keys++; } @@ -2269,10 +2273,8 @@ bool ha_myisam::check_if_incompatible_data(HA_CREATE_INFO *create_info, table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet return COMPATIBLE_DATA_NO; - if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM | - HA_OPTION_DELAY_KEY_WRITE)) != - (create_info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM | - HA_OPTION_DELAY_KEY_WRITE))) + if ((options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM)) != + (create_info->table_options & (HA_OPTION_PACK_RECORD | HA_OPTION_CHECKSUM))) return COMPATIBLE_DATA_NO; return COMPATIBLE_DATA_YES; } From b430133bb9549681147f806ba3048c382837a595 Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Tue, 23 May 2017 15:35:32 +0200 Subject: [PATCH 13/17] MDEV-12844 numerous issues in MASTER_GTID_WAIT() --- sql/item_func.cc | 2 +- sql/item_func.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sql/item_func.cc b/sql/item_func.cc index 5ad55e99b5b..b544f78fc12 100644 --- a/sql/item_func.cc +++ b/sql/item_func.cc @@ -3959,6 +3959,7 @@ longlong Item_master_gtid_wait::val_int() { DBUG_ASSERT(fixed == 1); longlong result= 0; + String *gtid_pos = args[0]->val_str(&value); if (args[0]->null_value) { @@ -3970,7 +3971,6 @@ longlong Item_master_gtid_wait::val_int() #ifdef HAVE_REPLICATION THD* thd= current_thd; longlong timeout_us; - String *gtid_pos = args[0]->val_str(&value); if (arg_count==2 && !args[1]->null_value) timeout_us= (longlong)(1e6*args[1]->val_real()); diff --git a/sql/item_func.h b/sql/item_func.h index 4d58e974a75..f44c5d14cda 100644 --- a/sql/item_func.h +++ b/sql/item_func.h @@ -1669,7 +1669,7 @@ public: Item_master_gtid_wait(THD *thd, Item *a, Item *b): Item_int_func(thd, a, b) {} longlong val_int(); const char *func_name() const { return "master_gtid_wait"; } - void fix_length_and_dec() { max_length=10+1+10+1+20+1; maybe_null=0;} + void fix_length_and_dec() { max_length=2; } bool check_vcol_func_processor(uchar *int_arg) { return trace_unsupported_by_check_vcol_func_processor(func_name()); From 6bc9949210806a5c9630d5af17c74c8f2c54a227 Mon Sep 17 00:00:00 2001 From: Elena Stepanova Date: Wed, 24 May 2017 20:38:40 +0300 Subject: [PATCH 14/17] Updated list of unstable tests for 10.1.24 release --- mysql-test/unstable-tests | 221 ++++++++++++++------------------------ 1 file changed, 79 insertions(+), 142 deletions(-) diff --git a/mysql-test/unstable-tests b/mysql-test/unstable-tests index 091aeff6b7c..d1e9a81a226 100644 --- a/mysql-test/unstable-tests +++ b/mysql-test/unstable-tests @@ -23,100 +23,92 @@ # ############################################################################## -main.alter_table : MDEV-12625 - Valgrind warnings, also modified in 10.1.22 -main.alter_table_trans : MDEV-11805 - timeout -main.analyze_format_json : MDEV-11866 - Wrong result; also uses analyze-format.inc modified in 10.1.22 -main.analyze_stmt_orderby : MDEV-11866 - Wrong result; also uses analyze-format.inc modified in 10.1.22 +main.alter_table_online : Modified in 10.1.24 +main.alter_table_trans : MDEV-12084 - timeout +main.analyze_format_json : MDEV-11866 - Wrong result +main.analyze_stmt_orderby : MDEV-11866 - Wrong result main.analyze_stmt_slow_query_log : MDEV-12237 - Wrong result main.create_delayed : MDEV-10605 - failed with timeout main.ctype_upgrade : Modified in 10.1.23 main.ctype_utf16le : MDEV-10675: timeout or extra warnings -main.derived : Modified in 10.1.22 -main.drop_bad_db_type : Modified in 10.1.22 +main.derived_view : Modified in 10.1.24 main.drop-no_root : MDEV-12633 - Valgrind warnings main.events_2 : Modified in 10.1.23 +main.events_bugs : MDEV-12892 - Crash in fill_schema_processlist main.events_restart : MDEV-12236 - Server shutdown problem -main.explain_json : Uses analyze-format.inc modified in 10.1.22 -main.explain_json_format_partitions : Uses analyze-format.inc modified in 10.1.22 +main.func_regexp_pcre : Modified in 10.1.24 main.gis : Modified in 10.1.23 -main.grant : Modified in 10.1.22 main.host_cache_size_functionality : MDEV-10606 - sporadic failure on shutdown main.index_intersect_innodb : MDEV-10643 - failed with timeout -main.index_merge_innodb : MDEV-7142 - Wrong execution plan +main.index_merge_innodb : MDEV-7142 - Wrong execution plan, timeout with valgrind main.innodb_mysql_lock : MDEV-7861 - sporadic lock detection failure -main.join_nested : Modified in 10.1.22 main.kill_processlist-6619 : MDEV-10793 - wrong result in processlist main.loaddata : Modified in 10.1.23 +main.loadxml : Modified in 10.1.24 main.log_tables-big : Modified in 10.1.23 main.mdev-504 : MDEV-10607 - sporadic "can't connect" main.mdev375 : MDEV-10607 - sporadic "can't connect" main.merge : MDEV-10607 - sporadic "can't connect" +main.myisam_debug : Modified in 10.1.24 main.mysqlcheck : MDEV-12633 - Valgrind warnings -main.mysqldump : Modified in 10.1.22 main.mysqlhotcopy_myisam : Uses mysqlhotcopy.inc modified in 10.1.23 main.mysqlslap : MDEV-11801 - timeout -main.mysqltest : MDEV-9269 - fails on Alpha +main.mysqltest : MDEV-9269 - fails on Alpha; modified in 10.1.24 main.mysql_client_test : MDEV-12633 - Valgrind warnings main.mysql_client_test_comp : MDEV-12633 - Valgrind warnings main.mysql_client_test_nonblock : MDEV-12633 - Valgrind warnings -main.mysql_upgrade_noengine : MDEV-12233 - Wrong result; added in 10.1.22 main.mysqldump : Modified in 10.1.23 main.mysqltest : Modified in 10.1.23 main.order_by_optimizer_innodb : MDEV-10683 - wrong execution plan -main.partition_column : Modified in 10.1.22 -main.partition_innodb : Modified in 10.1.22 -main.partition_myisam : Modified in 10.1.22 -main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count; also modified in 10.1.22 -main.range_vs_index_merge : Modified in 10.1.22 +main.partition_alter : Modified in 10.1.24 +main.ps : MDEV-11017 - sporadic wrong Prepared_stmt_count +main.query_cache : MDEV-12895 - Wrong result main.range_vs_index_merge_innodb : MDEV-12637 - Timeout -main.repair_symlink-5543 : MDEV-12215 - Wrong error codes; also modified in 10.1.22 +main.repair_symlink-5543 : MDEV-12215 - Wrong error codes main.show_check : MDEV-12633 - Valgrind warnings main.show_explain : MDEV-10674 - sporadic failure -main.sp : Modified in 10.1.22 main.sp-security : MDEV-10607 - sporadic "can't connect" -main.stat_tables_par : Modified in 10.1.22 main.status : MDEV-8510 - sporadic wrong result main.subselect4 : Modified in 10.1.23 -main.subselect_cache : Modified in 10.1.22 main.subselect_exists2in : Modified in 10.1.23 main.subselect_innodb : MDEV-10614 - sporadic wrong results; also modified in 10.1.23 +main.subselect_mat_cost_bugs : Modified in 10.1.24 +main.subselect_sj : Modified in 10.1.24 main.subselect_sj_mat : Modified in 10.1.23 +main.subselect_sj2_mat : Modified in 10.1.24 main.symlink : Modified in 10.1.23 -main.symlink-aria-11902 : MDEV-12215 - Unexpected errors; also added in 10.1.22 +main.symlink-aria-11902 : MDEV-12215 - Unexpected errors main.symlink-myisam-11902 : MDEV-12215 - Unexpected errors; modified in 10.1.23 -main.table_elim : Modified in 10.1.22 -main.trigger_no_defaults-11698 : Modified in 10.1.22 main.type_datetime_hires : MDEV-10687 - timeout -main.type_newdecimal : Modified in 10.1.22 -main.update_innodb : Modified in 10.1.22 main.view : Modified in 10.1.23 #---------------------------------------------------------------- -archive.archive-big : MDEV-10615 - table is marked as crashed archive.discover : MDEV-10510 - table is marked as crashed archive.mysqlhotcopy_archive : Uses mysqlhotcopy.inc modified in 10.1.23 #---------------------------------------------------------------- binlog.binlog_commit_wait : MDEV-10150 - Error: too much time elapsed -binlog.binlog_max_binlog_stmt_cache_size : Added in 10.1.22 binlog.binlog_xa_recover : MDEV-8517 - Extra checkpoint +binlog.mysqladmin : Added in 10.1.24 #---------------------------------------------------------------- -binlog_encryption.* : Added in 10.1.20, still unstable (valgrind errors and such) - +binlog_encryption.binlog_xa_recover : MDEV-12908 - Extra checkpoint +binlog_encryption.encrypted_master : MDEV-12906 - Failed to sync binlog_encryption.rpl_parallel : MDEV-10653 - Timeout binlog_encryption.rpl_semi_sync : MDEV-11220 - Wrong result, MDEV-11673 - Valgrind warning -binlog_encryption.rpl_ssl : MDEV-11542 - Server crash #---------------------------------------------------------------- +connect.jdbc_new : Modified in 10.1.24 connect.secure_file_priv : Modified in 10.1.23 connect.tbl : MDEV-9844, MDEV-10179 - sporadic crashes, valgrind warnings, wrong results -connect.xml_zip : Added in 10.1.22 -connect.zip : MDEV-12631 - Valgrind warnings; added in 10.1.22 + +#---------------------------------------------------------------- + +csv.read_only : Added in 10.1.24 #---------------------------------------------------------------- @@ -128,24 +120,22 @@ encryption.innodb-bad-key-change2 : MDEV-12632 - Valgrind warnings, mo encryption.innodb-bad-key-change4 : Modified in 10.1.23 encryption.innodb-compressed-blob : Added in 10.1.23 encryption.innodb-discard-import-change : MDEV-12632 - Valgrind warnings -encryption.innodb_encryption : MDEV-12623 - Assertion failure encryption.innodb-encryption-disable : Modified in 10.1.23 -encryption.innodb_encryption_discard_import : MDEV-11218 - wrong result +encryption.innodb_encryption_discard_import : MDEV-12903 - Wrong result encryption.innodb_encryption_filekeys : MDEV-9962 - timeouts -encryption.innodb_encryption-page-compression : MDEV-11420 - Trying to access missing tablespace, MDEV-12630 - assertion failure, modified in 10.1.23 -encryption.innodb_encryption_tables : MDEV-9359 - Assertion failure, MDEV-12623 - assertion failure, MDEV-12624 - timeout +encryption.innodb_encryption-page-compression : MDEV-12630 - crash or assertion failure, modified in 10.1.23 +encryption.innodb_encryption_tables : MDEV-9359 - Assertion failure encryption.innodb_first_page : MDEV-10689 - crashes encryption.innodb-force-corrupt : Added in 10.1.23 -encryption.innodb-key-rotation-disable : Added in 10.1.23 +encryption.innodb-key-rotation-disable : Modified in 10.1.24 encryption.innodb_lotoftables : MDEV-11531 - InnoDB error encryption.innodb-missing-key : MDEV-9359 - assertion failure; also modified in 10.1.23 -encryption.innodb_onlinealter_encryption : MDEV-10099 - wrong results; also modified in 10.1.23 +encryption.innodb_onlinealter_encryption : Modified in 10.1.23 encryption.innodb-page_encryption : MDEV-10641 - mutex problem encryption.innodb-page_encryption_compression : Modified in 10.1.23 encryption.innodb-page_encryption_log_encryption : Modified in 10.1.23 -encryption.innodb-redo-badkey : Added in 10.1.23 +encryption.innodb-redo-badkey : MDEV-12898 - Server hang on startup, also added in 10.1.23 encryption.innodb-redo-nokeys : Added in 10.1.23 -encryption.innodb-read-only : Added in 10.1.22 encryption.innodb_scrub : MDEV-8139 - scrubbing tests need fixing encryption.innodb_scrub_background : MDEV-8139 - scrubbing tests need fixing encryption.innodb_scrub_compressed : MDEV-8139 - scrubbing tests need fixing @@ -157,7 +147,8 @@ engines/funcs.* : Not maintained in timely manner #---------------------------------------------------------------- -federated.federated_bug_35333 : Modified in 10.1.22 +federated.assisted_discovery : Modified in 10.1.24 +federated.federated_bug_585688 : MDEV-12907 - Valgrind federated.federated_innodb : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips federated.federated_partition : MDEV-10417 - Fails on Mips federated.federated_transactions : MDEV-10617, MDEV-10417 - Wrong checksum, timeouts, fails on Mips @@ -165,7 +156,6 @@ federated.federatedx : MDEV-10617 - Wrong checksum, timeouts #---------------------------------------------------------------- -funcs_1.is_columns_mysql : Modified in 10.1.22 funcs_1.processlist_val_no_prot : MDEV-11223 - Wrong result funcs_2.memory_charset : MDEV-10290 - Timeout @@ -173,8 +163,6 @@ funcs_2.myisam_charset : MDEV-11535 - Timeout #---------------------------------------------------------------- -galera.* : suite.pm modified in 10.1.22 - galera.ev51914 : Added in 10.1.23 galera.GAL-401 : Added in 10.1.23 galera.GAL-419 : Added in 10.1.23 @@ -187,15 +175,12 @@ galera.galera_gcache_recover : Added in 10.1.23 galera.galera_gcache_recover_full_gcache : Added in 10.1.23 galera.galera_gcache_recover_manytrx : Added in 10.1.23 galera.galera_many_tables_pk : Modified in 10.1.23 -galera.galera_mdev_10812 : Added in 10.1.22 galera.galera_restart_on_unknown_option : Added in 10.1.23 galera.galera_roles : Modified in 10.1.23 galera.galera_toi_ddl_fk_update : Added in 10.1.23 galera.galera_toi_drop_database : Added in 10.1.23 galera.galera_toi_truncate : Added in 10.1.23 -galera.galera_var_certify_nonPK_off : Modified in 10.1.22 galera.galera_var_cluster_address : Modified in 10.1.23 -galera.galera_var_max_ws_rows : Modified in 10.1.22 galera.galera_var_retry_autocommit : Added in 10.1.23 galera.galera_var_slave_threads : Modified in 10.1.23 galera.galera_wsrep_log_conficts : Added in 10.1.23 @@ -221,61 +206,38 @@ galera_3nodes.galera_safe_to_bootstrap : Added in 10.1.23 #---------------------------------------------------------------- -innodb.101_compatibility : Modified in 10.1.22 -innodb.alter_key_block_size-11757 : Added in 10.1.22 innodb.autoinc_debug : Added in 10.1.23 innodb.binlog_consistent : MDEV-10618 - Server fails to start -innodb.doublewrite : Modified in 10.1.22 -innodb.innodb-32k-crash : Modified in 10.1.22 -innodb.innodb-64k-crash : Modified in 10.1.22 +innodb.doublewrite : MDEV-12905 - Lost connection to MySQL server innodb.innodb-alter-debug : Added in 10.1.23 innodb.innodb-alter-nullable : Added in 10.1.23 innodb.innodb-alter-table : MDEV-10619 - Testcase timeout -innodb.innodb-blob : MDEV-12053 - Client crash; also modified in 10.1.22 -innodb.innodb_blob_unrecoverable_crash : Modified in 10.1.22 -innodb.innodb-bug-14068765 : MDEV-9105 - valgrind warnings, assertion failures -innodb.innodb-bug-14084530 : MDEV-9105 - valgrind warnings, assertion failures -innodb.innodb_bug11754376 : Modified in 10.1.22 -innodb.innodb_bug14147491 : MDEV-11808, MDEV-12628 - wrong error codes, also modified in 10.1.23 +innodb.innodb-blob : MDEV-12053 - Client crash +innodb.innodb_bug14147491 : MDEV-11808 - wrong error codes, also modified in 10.1.24 innodb.innodb_bug14676111 : Modified in 10.1.23 innodb.innodb_bug30423 : MDEV-7311 - Wrong number of rows in the plan innodb.innodb_bug53290 : MDEV-12634 - Valgrind warnings -innodb.innodb_bug53756 : Modified in 10.1.22 -innodb.innodb_bug56947 : Modified in 10.1.22 -innodb.innodb_bug59641 : Modified in 10.1.22 innodb.innodb_defragment : Modified in 10.1.23 innodb.innodb_defragment_small : Added in 10.1.23 -innodb.innodb-get-fk : Modified in 10.1.22 innodb.innodb-index-online-norebuild : Added in 10.1.23 -innodb.innodb-page_compression_default : Added in 10.1.22 -innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem +innodb.innodb-page_compression_bzip2 : Modified in 10.1.24 +innodb.innodb-page_compression_default : Modified in 10.1.24 +innodb.innodb-page_compression_lz4 : Modified in 10.1.24 +innodb.innodb-page_compression_lzma : Modified in 10.1.24 +innodb.innodb-page_compression_lzo : Modified in 10.1.24 +innodb.innodb-page_compression_snappy : Modified in 10.1.24 +innodb.innodb-page_compression_zip : MDEV-10641 - mutex problem; modified in 10.1.24 +innodb.innodb_prefix_index_restart_server : MDEV-12899 - Server crash on shutdown innodb.innodb_stats : MDEV-10682 - wrong result innodb.innodb_sys_semaphore_waits : MDEV-10331 - wrong result -innodb.innodb-wl5522 : MDEV-9105 - valgrind warnings, assertion failures -innodb.innodb-wl5522-1 : MDEV-9105 - valgrind warnings, assertion failures -innodb.innodb-wl5522-debug : Modified in 10.1.22 -innodb.innodb-wl5522-debug-zip : Modified in 10.1.22 -innodb.log_file_size : MDEV-12635 - Valgrind warnings, added in 10.1.22 -innodb.read_only_recovery : Added in 10.1.22 -innodb.xa_recovery : Modified in 10.1.22 +innodb.log_data_file_size : MDEV-12893 - Database page corruption +innodb.log_file_size : Modified in 10.1.24 -innodb_fts.crash_recovery : Added in 10.1.22 -innodb_fts.create : MDEV-12625 - Valgrind warnings innodb_fts.fulltext_misc : MDEV-12636 - Valgrind warnings -innodb_fts.innodb-fts-ddl : MDEV-12625 - Valgrind warnings -innodb_fts.innodb-fts-fic : MDEV-12625 - Valgrind warnings -innodb_fts.innodb_fts_misc : MDEV-12625 - Valgrind warnings -innodb_fts.innodb_fts_misc_1 : MDEV-12625 - Valgrind warnings -innodb_fts.innodb_fts_multiple_index : MDEV-12625 - Valgrind warnings -innodb_fts.innodb_fts_proximity : MDEV-12625 - Valgrind warnings -innodb_fts.innodb_fts_result_cache_limit : Modified in 10.1.22 -innodb_fts.innodb_fts_stopword_charset : MDEV-12625 - Valgrind warnings; modified in 10.1.23 -innodb_fts.innodb_fts_transaction : MDEV-12625 - Valgrind warnings -innodb_fts.misc_debug : Added in 10.1.22 #---------------------------------------------------------------- -mariabackup.* : Added in 10.1.23 +mariabackup.* : suite.pm modified in 10.1.24 #---------------------------------------------------------------- @@ -299,64 +261,29 @@ multi_source.status_vars : MDEV-4632 - failed while waiting for Slave_received_h #---------------------------------------------------------------- -oqgraph.regression_mdev6282 : Modified in 10.1.22 -oqgraph.regression_mdev6345 : Modified in 10.1.22 +parts.partition_innodb_status_file : MDEV-12901 - Valgrind #---------------------------------------------------------------- -parts.partition_bigint_innodb : Added in 10.1.22 -parts.partition_bigint_myisam : Added in 10.1.22 -parts.partition_double_innodb : Added in 10.1.22 -parts.partition_double_myisam : Added in 10.1.22 -parts.partition_float_innodb : Modified in 10.1.22 -parts.partition_float_myisam : Modified in 10.1.22 -parts.partition_int_innodb : Modified in 10.1.22 -parts.partition_int_myisam : Modified in 10.1.22 -parts.partition_mediumint_innodb : Added in 10.1.22 -parts.partition_mediumint_myisam : Added in 10.1.22 -parts.partition_smallint_innodb : Added in 10.1.22 -parts.partition_smallint_myisam : Added in 10.1.22 -parts.partition_tinyint_innodb : Added in 10.1.22 -parts.partition_tinyint_myisam : Added in 10.1.22 - -#---------------------------------------------------------------- - -perfschema.csv_table_io : Uses table_io_result_helper.inc modified in 10.1.22 perfschema.func_file_io : MDEV-5708 - fails for s390x perfschema.func_mutex : MDEV-5708 - fails for s390x -perfschema.indexed_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.innodb_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.memory_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.merge_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.multi_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.myisam_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.part_table_io : Uses table_io_result_helper.inc modified in 10.1.22 perfschema.pfs_upgrade_event : Modified in 10.1.23 perfschema.pfs_upgrade_func : Modified in 10.1.23 perfschema.pfs_upgrade_proc : Modified in 10.1.23 perfschema.pfs_upgrade_table : Modified in 10.1.23 perfschema.pfs_upgrade_view : Modified in 10.1.23 -perfschema.privilege_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.rollback_table_io : Uses table_io_result_helper.inc modified in 10.1.22 perfschema.setup_actors : MDEV-10679 - rare crash perfschema.socket_summary_by_event_name_func : MDEV-10622 - Socket summary tables do not match perfschema.stage_mdl_global : MDEV-11803 - wrong result on slow builders -perfschema.stage_mdl_table : MDEV-12639 - Wrong result -perfschema.table_name : Modified in 10.1.22 -perfschema.temp_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.threads_mysql : MDEV-10677 - sporadic wrong result; also modified in 10.1.22 -perfschema.trigger_table_io : Uses table_io_result_helper.inc modified in 10.1.22 -perfschema.view_table_io : Uses table_io_result_helper.inc modified in 10.1.22 +perfschema.stage_mdl_table : MDEV-12638 - Wrong result +perfschema.start_server_1_digest : Added in 10.1.24 +perfschema.threads_mysql : MDEV-10677 - sporadic wrong result #---------------------------------------------------------------- -plugins.auth_ed25519 : Added in 10.1.22 -plugins.cracklib_password_check : MDEV-11650 - valgrind warnings plugins.feedback_plugin_send : MDEV-7932 - ssl failed for url -plugins.pam : MDEV-10940 - valgrind warnings plugins.server_audit : MDEV-9562 - crashes on sol10-sparc plugins.thread_pool_server_audit : MDEV-9562 - crashes on sol10-sparc -plugins.two_password_validations : MDEV-11650 - valgrind warnings #---------------------------------------------------------------- @@ -373,14 +300,13 @@ rpl.rpl_gtid_crash : MDEV-9501 - Warning: failed registering rpl.rpl_gtid_mdev9033 : MDEV-10680 - warnings rpl.rpl_gtid_stop_start : MDEV-10629 - Crash on shutdown, MDEV-12629 - Valgrind warnings rpl.rpl_gtid_until : MDEV-10625 - warnings in error log -rpl.rpl_heartbeat_basic : Modified in 10.1.22 rpl.rpl_innodb_bug30888 : MDEV-10417 - Fails on Mips rpl.rpl_insert : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_insert_delayed : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_invoked_features : MDEV-10417 - Fails on Mips rpl.rpl_mariadb_slave_capability : MDEV-11018 - sporadic wrong events in binlog +rpl.rpl_mdev-11092 : Added in 10.1.24 rpl.rpl_mdev6020 : MDEV-10630, MDEV-10417 - Timeouts, fails on Mips -rpl.rpl_mdev6386 : Modified in 10.1.22 rpl.rpl_mysql_upgrade : Modified in 10.1.23 rpl.rpl_parallel : MDEV-10653 - Timeouts rpl.rpl_parallel_optimistic : MDEV-10511 - timeout @@ -392,7 +318,7 @@ rpl.rpl_row_log_innodb : MDEV-10688 - Wrong result rpl.rpl_row_sp001 : MDEV-9329 - Fails on Ubuntu/s390x rpl.rpl_semi_sync : MDEV-11220 - Wrong result rpl.rpl_semi_sync_event_after_sync : MDEV-11806 - warnings -rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status +rpl.rpl_semi_sync_uninstall_plugin : MDEV-7140 - Wrong plugin status, MDEV-10892 - Assertion failure rpl.rpl_semi_sync_wait_point : MDEV-11807 - timeout in wait condition rpl.rpl_show_slave_hosts : MDEV-10681 - server startup problem rpl.rpl_skip_replication : MDEV-9268 - Fails with timeout in sync_slave_with_master on Alpha @@ -404,11 +330,14 @@ rpl.rpl_temporary_error2 : MDEV-10634 - Wrong number of retries spider.* : MDEV-9329 - tests are too memory-consuming +spider.spider_fixes_part : MDEV-12900 - Valgrind + spider/bg.direct_aggregate : MDEV-7098 - Trying to unlock mutex that wasn't locked spider/bg.direct_aggregate_part : MDEV-7098 - Trying to unlock mutex that wasn't locked -spider/bg.ha : MDEV-7914, MDEV-9329 - Crash, failures on s390x -spider/bg.ha_part : MDEV-9329 - Fails on Ubuntu/s390x -spider/bg.spider_fixes : MDEV-7098, MDEV-9329 - Mutex problem, failures on s390x +spider/bg.function : MDEV-12900 - Valgrind +spider/bg.ha : MDEV-7914 - Crash, MDEV-9329 - failures on s390x +spider/bg.ha_part : MDEV-7914 - Crash, MDEV-9329 - Fails on Ubuntu/s390x +spider/bg.spider_fixes : MDEV-7098 -Mutex problem, MDEV-9329 - failures on s390x, MDEV-12900 - Valgrind spider/bg.spider3_fixes : MDEV-12639 - Packets out of order spider/bg.vp_fixes : MDEV-9329 - Fails on Ubuntu/s390x @@ -429,49 +358,58 @@ stress.ddl_innodb : MDEV-10635 - Testcase timeout #---------------------------------------------------------------- sys_vars.autocommit_func2 : MDEV-9329 - Fails on Ubuntu/s390x +sys_vars.delay_key_write_func : Modified in 10.1.24 sys_vars.keep_files_on_create_basic : MDEV-10676 - timeout sys_vars.innodb_buffer_pool_dump_pct_basic : MDEV-10651 - sporadic failure on file_exists sys_vars.innodb_fatal_semaphore_wait_threshold : MDEV-10513 - crashes -sys_vars.innodb_stats_include_delete_marked_basic : Added in 10.1.22 sys_vars.log_slow_admin_statements_func : MDEV-12235 - Server crash sys_vars.rpl_init_slave_func : MDEV-10149 - wrong results -sys_vars.secure_file_priv : Modified in 10.1.22 sys_vars.sysvars_innodb : MDEV-6958 - error-prone rdiffs sys_vars.sysvars_server_embedded : MDEV-6958 - error-prone rdiffs sys_vars.sysvars_wsrep : MDEV-12522 - Dependency on specific wsrep_provider +sys_vars.thread_cache_size_func : MDEV-11775 - Wrong result +sys_vars.wait_timeout_func : MDEV-12896 - Wrong result +sys_vars.sysvars_wsrep : Modified in 10.1.24 #---------------------------------------------------------------- +tokudb.bug-1657908 : Added in 10.1.24 tokudb.change_column_all_1000_10 : MDEV-12640 - Crash tokudb.change_column_bin : MDEV-12640 - Crash +tokudb.change_column_char : MDEV-12822 - Lost connection to MySQL server tokudb.cluster_filter : MDEV-10678 - Wrong execution plan tokudb.cluster_filter_hidden : MDEV-10678 - Wrong execution plan tokudb.cluster_filter_unpack_varchar : MDEV-10636 - Wrong execution plan tokudb.dir_per_db : MDEV-11537 - Wrong result -tokudb.dir_per_db_rename_to_nonexisting_schema : Added in 10.1.22 -tokudb.gap_lock_error : Added in 10.1.22 tokudb.hotindex-insert-bigchar : MDEV-12640 - Crash tokudb.hotindex-update-1 : MDEV-12640 - Crash -tokudb.locks-select-update-3 : Modified in 10.1.22 -tokudb.percona_kill_idle_trx_tokudb : Modified in 10.1.22 tokudb.rows-32m-rand-insert : MDEV-12640 - Crash tokudb.rows-32m-seq-insert : MDEV-12640 - Crash -tokudb_backup.* : suite.opt modified in 10.1.22 +tokudb_backup.backup_master_info : Added in 10.1.24 +tokudb_backup.backup_master_state : Added in 10.1.24 +tokudb_backup.empty_slave_info_file : Added in 10.1.24 +tokudb_backup.innodb_use_native_aio_enabled : Added in 10.1.24 +tokudb_backup.rpl_safe_slave : Added in 10.1.24 +tokudb_backup.rpl_tokudb_commit_sync : Added in 10.1.24 tokudb_bugs.checkpoint_lock : MDEV-10637 - Wrong processlist output tokudb_bugs.checkpoint_lock_3 : MDEV-10637 - Wrong processlist output +tokudb_bugs.db233 : Modified in 10.1.24 +tokudb_bugs.leak172 : Modified in 10.1.24 tokudb_bugs.xa : MDEV-11804 - Lock wait timeout +tokudb_mariadb.mdev6657 : MDEV-12737 - Wrong plan, valgrind warnings + #---------------------------------------------------------------- +unit.lf : MDEV-12897 - Signal 11 thrown unit.ma_test_loghandler : MDEV-10638 - record read not ok #---------------------------------------------------------------- vcol.not_supported : MDEV-10639 - Testcase timeout vcol.vcol_keys_innodb : MDEV-10639 - Testcase timeout -vcol.vcol_select_myisam : Modified in 10.1.22 #---------------------------------------------------------------- @@ -479,5 +417,4 @@ wsrep.binlog_format : MDEV-11532 - WSREP has not yet prepared node wsrep.pool_of_threads : MDEV-12234 - Library problem on Power wsrep.wsrep_rpl : Modified in 10.1.23 -wsrep_info.* : suite.pm changed in 10.1.22 -wsrep_info.plugin : MDEV-12232 - Crash on Power +wsrep_info.plugin : MDEV-12909 - Wrong result From 449a88e1c629b742e8be152c896c65a8bda5c817 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 23 May 2017 12:17:43 +0300 Subject: [PATCH 15/17] MDEV-12052 Shutdown crash presumably due to master thread activity InnoDB shutdown assumes that once the server has entered SRV_SHUTDOWN_FLUSH_PHASE, no change to persistent data is allowed. It was possible for the master thread to wake up while shutdown is executing in SRV_SHUTDOWN_FLUSH_PHASE or even in SRV_SHUTDOWN_LAST_PHASE. We do not yet know if further crashes at shutdown are possible. Also, we do not know if all the observed crashes could be explained by the race conditions that we are now fixing. srv_shutdown_print_master_pending(): Remove a redundant ut_time() call. srv_shutdown(): Renamed from srv_master_do_shutdown_tasks(). srv_master_thread(): Do not resume after shutdown has been initiated. --- .../innodb/r/drop_table_background.result | 9 ++ .../suite/innodb/t/drop_table_background.test | 30 ++++ storage/innobase/srv/srv0srv.cc | 141 +++++++----------- storage/xtradb/srv/srv0srv.cc | 141 +++++++----------- 4 files changed, 151 insertions(+), 170 deletions(-) create mode 100644 mysql-test/suite/innodb/r/drop_table_background.result create mode 100644 mysql-test/suite/innodb/t/drop_table_background.test diff --git a/mysql-test/suite/innodb/r/drop_table_background.result b/mysql-test/suite/innodb/r/drop_table_background.result new file mode 100644 index 00000000000..a6f5672ba7f --- /dev/null +++ b/mysql-test/suite/innodb/r/drop_table_background.result @@ -0,0 +1,9 @@ +CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT, +KEY(c1), KEY(c2), KEY(c2,c1), +KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1), +KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1), +KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB; +SET DEBUG_DBUG='+d,row_drop_table_add_to_background'; +DROP TABLE t; +CREATE TABLE t (a INT) ENGINE=InnoDB; +DROP TABLE t; diff --git a/mysql-test/suite/innodb/t/drop_table_background.test b/mysql-test/suite/innodb/t/drop_table_background.test new file mode 100644 index 00000000000..0f596dec574 --- /dev/null +++ b/mysql-test/suite/innodb/t/drop_table_background.test @@ -0,0 +1,30 @@ +--source include/have_innodb.inc +--source include/have_debug.inc +# Embedded server does not support restarting +--source include/not_embedded.inc + +CREATE TABLE t(c0 SERIAL, c1 INT, c2 INT, c3 INT, c4 INT, +KEY(c1), KEY(c2), KEY(c2,c1), +KEY(c3), KEY(c3,c1), KEY(c3,c2), KEY(c3,c2,c1), +KEY(c4), KEY(c4,c1), KEY(c4,c2), KEY(c4,c2,c1), +KEY(c4,c3), KEY(c4,c3,c1), KEY(c4,c3,c2), KEY(c4,c3,c2,c1)) ENGINE=InnoDB; + +let $n= 10; + +SET DEBUG_DBUG='+d,row_drop_table_add_to_background'; +--disable_query_log +let $i= $n; +while ($i) { + eval CREATE TABLE t$i LIKE t; + dec $i; +} +let $i= $n; +while ($i) { + eval DROP TABLE t$i; + dec $i; +} +--enable_query_log +DROP TABLE t; +--source include/restart_mysqld.inc +CREATE TABLE t (a INT) ENGINE=InnoDB; +DROP TABLE t; diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index fd85b8500b8..93ed302a236 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1715,7 +1715,7 @@ loop: } } - if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { goto exit_func; } @@ -1845,7 +1845,7 @@ loop: os_event_wait_time_low(srv_error_event, 1000000, sig_count); - if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { + if (srv_shutdown_state == SRV_SHUTDOWN_NONE) { goto loop; } @@ -2105,7 +2105,7 @@ srv_shutdown_print_master_pending( time_elapsed = ut_difftime(current_time, *last_print_time); if (time_elapsed > 60) { - *last_print_time = ut_time(); + *last_print_time = current_time; if (n_tables_to_drop) { ut_print_timestamp(stderr); @@ -2157,7 +2157,7 @@ srv_master_do_active_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2191,11 +2191,7 @@ srv_master_do_active_tasks(void) MONITOR_SRV_MEM_VALIDATE_MICROSECOND, counter_time); } #endif - if (srv_shutdown_state > 0) { - return; - } - - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2206,7 +2202,7 @@ srv_master_do_active_tasks(void) MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time); } - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2249,7 +2245,7 @@ srv_master_do_idle_tasks(void) MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2265,7 +2261,7 @@ srv_master_do_idle_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2279,7 +2275,7 @@ srv_master_do_idle_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2290,70 +2286,42 @@ srv_master_do_idle_tasks(void) counter_time); } -/*********************************************************************//** -Perform the tasks during shutdown. The tasks that we do at shutdown -depend on srv_fast_shutdown: -2 => very fast shutdown => do no book keeping -1 => normal shutdown => clear drop table queue and make checkpoint -0 => slow shutdown => in addition to above do complete purge and ibuf -merge -@return TRUE if some work was done. FALSE otherwise */ +/** Perform shutdown tasks. +@param[in] ibuf_merge whether to complete the change buffer merge */ static -ibool -srv_master_do_shutdown_tasks( -/*=========================*/ - ib_time_t* last_print_time)/*!< last time the function - print the message */ +void +srv_shutdown(bool ibuf_merge) { - ulint n_bytes_merged = 0; - ulint n_tables_to_drop = 0; + ulint n_bytes_merged = 0; + ulint n_tables_to_drop; + ib_time_t now = ut_time(); - ut_ad(!srv_read_only_mode); + do { + ut_ad(!srv_read_only_mode); + ut_ad(srv_shutdown_state == SRV_SHUTDOWN_CLEANUP); + ++srv_main_shutdown_loops; - ++srv_main_shutdown_loops; + /* FIXME: Remove the background DROP TABLE queue; it is not + crash-safe and breaks ACID. */ + srv_main_thread_op_info = "doing background drop tables"; + n_tables_to_drop = row_drop_tables_for_mysql_in_background(); - ut_a(srv_shutdown_state > 0); + if (ibuf_merge) { + srv_main_thread_op_info = "checking free log space"; + log_free_check(); + srv_main_thread_op_info = "doing insert buffer merge"; + n_bytes_merged = ibuf_merge_in_background(true); - /* In very fast shutdown none of the following is necessary */ - if (srv_fast_shutdown == 2) { - return(FALSE); - } + /* Flush logs if needed */ + srv_sync_log_buffer_in_background(); + } - /* ALTER TABLE in MySQL requires on Unix that the table handler - can drop tables lazily after there no longer are SELECT - queries to them. */ - srv_main_thread_op_info = "doing background drop tables"; - n_tables_to_drop = row_drop_tables_for_mysql_in_background(); - - /* make sure that there is enough reusable space in the redo - log files */ - srv_main_thread_op_info = "checking free log space"; - log_free_check(); - - /* In case of normal shutdown we don't do ibuf merge or purge */ - if (srv_fast_shutdown == 1) { - goto func_exit; - } - - /* Do an ibuf merge */ - srv_main_thread_op_info = "doing insert buffer merge"; - n_bytes_merged = ibuf_merge_in_background(true); - - /* Flush logs if needed */ - srv_sync_log_buffer_in_background(); - -func_exit: - /* Make a new checkpoint about once in 10 seconds */ - srv_main_thread_op_info = "making checkpoint"; - log_checkpoint(TRUE, FALSE); - - /* Print progress message every 60 seconds during shutdown */ - if (srv_shutdown_state > 0 && srv_print_verbose_log) { - srv_shutdown_print_master_pending( - last_print_time, n_tables_to_drop, n_bytes_merged); - } - - return(n_bytes_merged || n_tables_to_drop); + /* Print progress message every 60 seconds during shutdown */ + if (srv_print_verbose_log) { + srv_shutdown_print_master_pending( + &now, n_tables_to_drop, n_bytes_merged); + } + } while (n_bytes_merged || n_tables_to_drop); } /*********************************************************************//** @@ -2385,7 +2353,6 @@ DECLARE_THREAD(srv_master_thread)( srv_slot_t* slot; ulint old_activity_count = srv_get_activity_count(); - ib_time_t last_print_time; ut_ad(!srv_read_only_mode); @@ -2404,7 +2371,6 @@ DECLARE_THREAD(srv_master_thread)( slot = srv_reserve_slot(SRV_MASTER); ut_a(slot == srv_sys.sys_threads); - last_print_time = ut_time(); loop: if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) { goto suspend_thread; @@ -2424,13 +2390,26 @@ loop: } } - while (srv_master_do_shutdown_tasks(&last_print_time)) { - - /* Shouldn't loop here in case of very fast shutdown */ - ut_ad(srv_fast_shutdown < 2); +suspend_thread: + switch (srv_shutdown_state) { + case SRV_SHUTDOWN_NONE: + break; + case SRV_SHUTDOWN_FLUSH_PHASE: + case SRV_SHUTDOWN_LAST_PHASE: + ut_ad(0); + /* fall through */ + case SRV_SHUTDOWN_EXIT_THREADS: + /* srv_init_abort() must have been invoked */ + case SRV_SHUTDOWN_CLEANUP: + if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP + && srv_fast_shutdown < 2) { + srv_shutdown(srv_fast_shutdown == 1); + } + srv_suspend_thread(slot); + my_thread_end(); + os_thread_exit(NULL); } -suspend_thread: srv_main_thread_op_info = "suspending"; srv_suspend_thread(slot); @@ -2442,15 +2421,7 @@ suspend_thread: srv_main_thread_op_info = "waiting for server activity"; srv_resume_thread(slot); - - if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) { - my_thread_end(); - os_thread_exit(NULL); - } - goto loop; - - OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */ } /*********************************************************************//** diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index bd1bc2c7131..d18abbe0574 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -2147,7 +2147,7 @@ loop: } } - if (srv_shutdown_state >= SRV_SHUTDOWN_CLEANUP) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { goto exit_func; } @@ -2277,7 +2277,7 @@ loop: os_event_wait_time_low(srv_error_event, 1000000, sig_count); - if (srv_shutdown_state < SRV_SHUTDOWN_CLEANUP) { + if (srv_shutdown_state == SRV_SHUTDOWN_NONE) { goto loop; } @@ -2756,7 +2756,7 @@ srv_shutdown_print_master_pending( time_elapsed = ut_difftime(current_time, *last_print_time); if (time_elapsed > 60) { - *last_print_time = ut_time(); + *last_print_time = current_time; if (n_tables_to_drop) { ut_print_timestamp(stderr); @@ -2808,7 +2808,7 @@ srv_master_do_active_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2842,11 +2842,7 @@ srv_master_do_active_tasks(void) MONITOR_SRV_MEM_VALIDATE_MICROSECOND, counter_time); } #endif - if (srv_shutdown_state > 0) { - return; - } - - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2857,7 +2853,7 @@ srv_master_do_active_tasks(void) MONITOR_SRV_DICT_LRU_MICROSECOND, counter_time); } - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2900,7 +2896,7 @@ srv_master_do_idle_tasks(void) MONITOR_SRV_BACKGROUND_DROP_TABLE_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2916,7 +2912,7 @@ srv_master_do_idle_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_IBUF_MERGE_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2930,7 +2926,7 @@ srv_master_do_idle_tasks(void) MONITOR_INC_TIME_IN_MICRO_SECS( MONITOR_SRV_LOG_FLUSH_MICROSECOND, counter_time); - if (srv_shutdown_state > 0) { + if (srv_shutdown_state != SRV_SHUTDOWN_NONE) { return; } @@ -2951,70 +2947,42 @@ srv_master_do_idle_tasks(void) } } -/*********************************************************************//** -Perform the tasks during shutdown. The tasks that we do at shutdown -depend on srv_fast_shutdown: -2 => very fast shutdown => do no book keeping -1 => normal shutdown => clear drop table queue and make checkpoint -0 => slow shutdown => in addition to above do complete purge and ibuf -merge -@return TRUE if some work was done. FALSE otherwise */ +/** Perform shutdown tasks. +@param[in] ibuf_merge whether to complete the change buffer merge */ static -ibool -srv_master_do_shutdown_tasks( -/*=========================*/ - ib_time_t* last_print_time)/*!< last time the function - print the message */ +void +srv_shutdown(bool ibuf_merge) { - ulint n_bytes_merged = 0; - ulint n_tables_to_drop = 0; + ulint n_bytes_merged = 0; + ulint n_tables_to_drop; + ib_time_t now = ut_time(); - ut_ad(!srv_read_only_mode); + do { + ut_ad(!srv_read_only_mode); + ut_ad(srv_shutdown_state == SRV_SHUTDOWN_CLEANUP); + ++srv_main_shutdown_loops; - ++srv_main_shutdown_loops; + /* FIXME: Remove the background DROP TABLE queue; it is not + crash-safe and breaks ACID. */ + srv_main_thread_op_info = "doing background drop tables"; + n_tables_to_drop = row_drop_tables_for_mysql_in_background(); - ut_a(srv_shutdown_state > 0); + if (ibuf_merge) { + srv_main_thread_op_info = "checking free log space"; + log_free_check(); + srv_main_thread_op_info = "doing insert buffer merge"; + n_bytes_merged = ibuf_merge_in_background(true); - /* In very fast shutdown none of the following is necessary */ - if (srv_fast_shutdown == 2) { - return(FALSE); - } + /* Flush logs if needed */ + srv_sync_log_buffer_in_background(); + } - /* ALTER TABLE in MySQL requires on Unix that the table handler - can drop tables lazily after there no longer are SELECT - queries to them. */ - srv_main_thread_op_info = "doing background drop tables"; - n_tables_to_drop = row_drop_tables_for_mysql_in_background(); - - /* make sure that there is enough reusable space in the redo - log files */ - srv_main_thread_op_info = "checking free log space"; - log_free_check(); - - /* In case of normal shutdown we don't do ibuf merge or purge */ - if (srv_fast_shutdown == 1) { - goto func_exit; - } - - /* Do an ibuf merge */ - srv_main_thread_op_info = "doing insert buffer merge"; - n_bytes_merged = ibuf_merge_in_background(true); - - /* Flush logs if needed */ - srv_sync_log_buffer_in_background(); - -func_exit: - /* Make a new checkpoint about once in 10 seconds */ - srv_main_thread_op_info = "making checkpoint"; - log_checkpoint(TRUE, FALSE, FALSE); - - /* Print progress message every 60 seconds during shutdown */ - if (srv_shutdown_state > 0 && srv_print_verbose_log) { - srv_shutdown_print_master_pending( - last_print_time, n_tables_to_drop, n_bytes_merged); - } - - return(n_bytes_merged || n_tables_to_drop); + /* Print progress message every 60 seconds during shutdown */ + if (srv_print_verbose_log) { + srv_shutdown_print_master_pending( + &now, n_tables_to_drop, n_bytes_merged); + } + } while (n_bytes_merged || n_tables_to_drop); } /*********************************************************************//** @@ -3048,7 +3016,6 @@ DECLARE_THREAD(srv_master_thread)( ulint old_activity_count = srv_get_activity_count(); ulint old_ibuf_merge_activity_count = srv_get_ibuf_merge_activity_count(); - ib_time_t last_print_time; ut_ad(!srv_read_only_mode); @@ -3071,7 +3038,6 @@ DECLARE_THREAD(srv_master_thread)( slot = srv_reserve_slot(SRV_MASTER); ut_a(slot == srv_sys.sys_threads); - last_print_time = ut_time(); loop: if (srv_force_recovery >= SRV_FORCE_NO_BACKGROUND) { goto suspend_thread; @@ -3097,13 +3063,26 @@ loop: } } - while (srv_master_do_shutdown_tasks(&last_print_time)) { - - /* Shouldn't loop here in case of very fast shutdown */ - ut_ad(srv_fast_shutdown < 2); +suspend_thread: + switch (srv_shutdown_state) { + case SRV_SHUTDOWN_NONE: + break; + case SRV_SHUTDOWN_FLUSH_PHASE: + case SRV_SHUTDOWN_LAST_PHASE: + ut_ad(0); + /* fall through */ + case SRV_SHUTDOWN_EXIT_THREADS: + /* srv_init_abort() must have been invoked */ + case SRV_SHUTDOWN_CLEANUP: + if (srv_shutdown_state == SRV_SHUTDOWN_CLEANUP + && srv_fast_shutdown < 2) { + srv_shutdown(srv_fast_shutdown == 1); + } + srv_suspend_thread(slot); + my_thread_end(); + os_thread_exit(NULL); } -suspend_thread: srv_main_thread_op_info = "suspending"; srv_suspend_thread(slot); @@ -3115,15 +3094,7 @@ suspend_thread: srv_main_thread_op_info = "waiting for server activity"; srv_resume_thread(slot); - - if (srv_shutdown_state == SRV_SHUTDOWN_EXIT_THREADS) { - my_thread_end(); - os_thread_exit(NULL); - } - goto loop; - - OS_THREAD_DUMMY_RETURN; /* Not reached, avoid compiler warning */ } /*********************************************************************//** From 2f29fc3c1c4262919633ab53c80f195ec67a32e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Tue, 23 May 2017 12:17:43 +0300 Subject: [PATCH 16/17] 10.1 additions for MDEV-12052 Shutdown crash presumably due to master thread activity btr_defragment_thread(): Create the thread in the same place as other threads. Do not invoke btr_defragment_shutdown(), because row_drop_tables_for_mysql_in_background() in the master thread can still keep invoking btr_defragment_remove_table(). logs_empty_and_mark_files_at_shutdown(): Wait for btr_defragment_thread() to exit. innobase_start_or_create_for_mysql(), innobase_shutdown_for_mysql(): Skip encryption and scrubbing in innodb_read_only_mode. srv_export_innodb_status(): Do not export encryption or scrubbing statistics in innodb_read_only mode, because the threads will not be running. --- storage/innobase/btr/btr0defragment.cc | 18 +++++++++--------- storage/innobase/include/btr0defragment.h | 14 ++++++-------- storage/innobase/log/log0log.cc | 7 +++++-- storage/innobase/srv/srv0srv.cc | 8 ++++++-- storage/innobase/srv/srv0start.cc | 19 ++++++++++--------- storage/xtradb/btr/btr0defragment.cc | 18 +++++++++--------- storage/xtradb/include/btr0defragment.h | 15 +++++++-------- storage/xtradb/log/log0log.cc | 7 +++++-- storage/xtradb/srv/srv0srv.cc | 8 ++++++-- storage/xtradb/srv/srv0start.cc | 19 ++++++++++--------- 10 files changed, 73 insertions(+), 60 deletions(-) diff --git a/storage/innobase/btr/btr0defragment.cc b/storage/innobase/btr/btr0defragment.cc index 9933884bbfe..ca4c90eef41 100644 --- a/storage/innobase/btr/btr0defragment.cc +++ b/storage/innobase/btr/btr0defragment.cc @@ -154,7 +154,6 @@ btr_defragment_init() 1000000.0 / srv_defragment_frequency); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); - os_thread_create(btr_defragment_thread, NULL, NULL); } /******************************************************************//** @@ -735,14 +734,13 @@ btr_defragment_n_pages( return current_block; } -/******************************************************************//** -Thread that merges consecutive b-tree pages into fewer pages to defragment -the index. */ +/** Whether btr_defragment_thread is active */ +bool btr_defragment_thread_active; + +/** Merge consecutive b-tree pages into fewer pages to defragment indexes */ extern "C" UNIV_INTERN os_thread_ret_t -DECLARE_THREAD(btr_defragment_thread)( -/*==========================================*/ - void* arg) /*!< in: work queue */ +DECLARE_THREAD(btr_defragment_thread)(void*) { btr_pcur_t* pcur; btr_cur_t* cursor; @@ -752,6 +750,8 @@ DECLARE_THREAD(btr_defragment_thread)( buf_block_t* last_block; while (srv_shutdown_state == SRV_SHUTDOWN_NONE) { + ut_ad(btr_defragment_thread_active); + /* If defragmentation is disabled, sleep before checking whether it's enabled. */ if (!srv_defragment) { @@ -825,9 +825,9 @@ DECLARE_THREAD(btr_defragment_thread)( btr_defragment_remove_item(item); } } - btr_defragment_shutdown(); + + btr_defragment_thread_active = false; os_thread_exit(NULL); OS_THREAD_DUMMY_RETURN; } - #endif /* !UNIV_HOTBACKUP */ diff --git a/storage/innobase/include/btr0defragment.h b/storage/innobase/include/btr0defragment.h index 6257c4bc996..477824c1a35 100644 --- a/storage/innobase/include/btr0defragment.h +++ b/storage/innobase/include/btr0defragment.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved. -Copyright (C) 2014, 2015, MariaDB Corporation. +Copyright (C) 2014, 2017, 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 @@ -89,16 +89,14 @@ UNIV_INTERN void btr_defragment_save_defrag_stats_if_needed( dict_index_t* index); /*!< in: index */ -/******************************************************************//** -Thread that merges consecutive b-tree pages into fewer pages to defragment -the index. */ + +/** Merge consecutive b-tree pages into fewer pages to defragment indexes */ extern "C" UNIV_INTERN os_thread_ret_t -DECLARE_THREAD(btr_defragment_thread)( -/*==========================================*/ - void* arg); /*!< in: a dummy parameter required by - os_thread_create */ +DECLARE_THREAD(btr_defragment_thread)(void*); +/** Whether btr_defragment_thread is active */ +extern bool btr_defragment_thread_active; #endif /* !UNIV_HOTBACKUP */ #endif diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index 8b97ccf890e..14d1f4544cd 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -45,12 +45,13 @@ Created 12/9/1995 Heikki Tuuri #include "mem0mem.h" #include "buf0buf.h" #include "buf0flu.h" -#include "srv0srv.h" #include "lock0lock.h" #include "log0recv.h" #include "fil0fil.h" #include "dict0boot.h" -#include "dict0stats_bg.h" /* dict_stats_event */ +#include "dict0stats_bg.h" +#include "btr0defragment.h" +#include "srv0srv.h" #include "srv0start.h" #include "trx0sys.h" #include "trx0trx.h" @@ -3300,6 +3301,8 @@ loop: thread_name = "lock_wait_timeout_thread"; } else if (srv_buf_dump_thread_active) { thread_name = "buf_dump_thread"; + } else if (btr_defragment_thread_active) { + thread_name = "btr_defragment_thread"; } else if (srv_fast_shutdown != 2 && trx_rollback_or_clean_is_active) { thread_name = "rollback of recovered transactions"; } else { diff --git a/storage/innobase/srv/srv0srv.cc b/storage/innobase/srv/srv0srv.cc index 21ba050b952..787ec97d5a9 100644 --- a/storage/innobase/srv/srv0srv.cc +++ b/storage/innobase/srv/srv0srv.cc @@ -1457,8 +1457,10 @@ srv_export_innodb_status(void) buf_get_total_stat(&stat); buf_get_total_list_len(&LRU_len, &free_len, &flush_list_len); buf_get_total_list_size_in_bytes(&buf_pools_list_size); - fil_crypt_total_stat(&crypt_stat); - btr_scrub_total_stat(&scrub_stat); + if (!srv_read_only_mode) { + fil_crypt_total_stat(&crypt_stat); + btr_scrub_total_stat(&scrub_stat); + } mutex_enter(&srv_innodb_monitor_mutex); @@ -1660,6 +1662,7 @@ srv_export_innodb_status(void) export_vars.innodb_sec_rec_cluster_reads_avoided = srv_stats.n_sec_rec_cluster_reads_avoided; + if (!srv_read_only_mode) { export_vars.innodb_encryption_rotation_pages_read_from_cache = crypt_stat.pages_read_from_cache; export_vars.innodb_encryption_rotation_pages_read_from_disk = @@ -1687,6 +1690,7 @@ srv_export_innodb_status(void) scrub_stat.page_split_failures_missing_index; export_vars.innodb_scrub_page_split_failures_unknown = scrub_stat.page_split_failures_unknown; + } mutex_exit(&srv_innodb_monitor_mutex); } diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index f3304c5dad8..be65e4a6d17 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2981,14 +2981,16 @@ files_checked: fil_system_enter(); fil_crypt_threads_init(); fil_system_exit(); + + /* Init data for datafile scrub threads */ + btr_scrub_init(); + + /* Initialize online defragmentation. */ + btr_defragment_init(); + btr_defragment_thread_active = true; + os_thread_create(btr_defragment_thread, NULL, NULL); } - /* Init data for datafile scrub threads */ - btr_scrub_init(); - - /* Initialize online defragmentation. */ - btr_defragment_init(); - srv_was_started = TRUE; return(DB_SUCCESS); @@ -3158,11 +3160,10 @@ innobase_shutdown_for_mysql(void) if (!srv_read_only_mode) { dict_stats_thread_deinit(); fil_crypt_threads_cleanup(); + btr_scrub_cleanup(); + btr_defragment_shutdown(); } - /* Cleanup data for datafile scrubbing */ - btr_scrub_cleanup(); - #ifdef __WIN__ /* MDEV-361: ha_innodb.dll leaks handles on Windows MDEV-7403: should not pass recv_writer_thread_handle to diff --git a/storage/xtradb/btr/btr0defragment.cc b/storage/xtradb/btr/btr0defragment.cc index b3978722c1a..44acd9118d7 100644 --- a/storage/xtradb/btr/btr0defragment.cc +++ b/storage/xtradb/btr/btr0defragment.cc @@ -154,7 +154,6 @@ btr_defragment_init() 1000000.0 / srv_defragment_frequency); mutex_create(btr_defragment_mutex_key, &btr_defragment_mutex, SYNC_ANY_LATCH); - os_thread_create(btr_defragment_thread, NULL, NULL); } /******************************************************************//** @@ -735,14 +734,13 @@ btr_defragment_n_pages( return current_block; } -/******************************************************************//** -Thread that merges consecutive b-tree pages into fewer pages to defragment -the index. */ +/** Whether btr_defragment_thread is active */ +bool btr_defragment_thread_active; + +/** Merge consecutive b-tree pages into fewer pages to defragment indexes */ extern "C" UNIV_INTERN os_thread_ret_t -DECLARE_THREAD(btr_defragment_thread)( -/*==========================================*/ - void* arg) /*!< in: work queue */ +DECLARE_THREAD(btr_defragment_thread)(void*) { btr_pcur_t* pcur; btr_cur_t* cursor; @@ -752,6 +750,8 @@ DECLARE_THREAD(btr_defragment_thread)( buf_block_t* last_block; while (srv_shutdown_state == SRV_SHUTDOWN_NONE) { + ut_ad(btr_defragment_thread_active); + /* If defragmentation is disabled, sleep before checking whether it's enabled. */ if (!srv_defragment) { @@ -825,9 +825,9 @@ DECLARE_THREAD(btr_defragment_thread)( btr_defragment_remove_item(item); } } - btr_defragment_shutdown(); + + btr_defragment_thread_active = false; os_thread_exit(NULL); OS_THREAD_DUMMY_RETURN; } - #endif /* !UNIV_HOTBACKUP */ diff --git a/storage/xtradb/include/btr0defragment.h b/storage/xtradb/include/btr0defragment.h index 5c54b898e37..477824c1a35 100644 --- a/storage/xtradb/include/btr0defragment.h +++ b/storage/xtradb/include/btr0defragment.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (C) 2013, 2014 Facebook, Inc. All Rights Reserved. -Copyright (C) 2014, 2015, MariaDB Corporation. +Copyright (C) 2014, 2017, 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 @@ -89,15 +89,14 @@ UNIV_INTERN void btr_defragment_save_defrag_stats_if_needed( dict_index_t* index); /*!< in: index */ -/******************************************************************//** -Thread that merges consecutive b-tree pages into fewer pages to defragment -the index. */ + +/** Merge consecutive b-tree pages into fewer pages to defragment indexes */ extern "C" UNIV_INTERN os_thread_ret_t -DECLARE_THREAD(btr_defragment_thread)( -/*==========================================*/ - void* arg); /*!< in: a dummy parameter required by - os_thread_create */ +DECLARE_THREAD(btr_defragment_thread)(void*); + +/** Whether btr_defragment_thread is active */ +extern bool btr_defragment_thread_active; #endif /* !UNIV_HOTBACKUP */ #endif diff --git a/storage/xtradb/log/log0log.cc b/storage/xtradb/log/log0log.cc index d39bcb87117..eae7f2bb09b 100644 --- a/storage/xtradb/log/log0log.cc +++ b/storage/xtradb/log/log0log.cc @@ -55,12 +55,13 @@ Created 12/9/1995 Heikki Tuuri #include "mem0mem.h" #include "buf0buf.h" #include "buf0flu.h" -#include "srv0srv.h" #include "lock0lock.h" #include "log0recv.h" #include "fil0fil.h" #include "dict0boot.h" -#include "dict0stats_bg.h" /* dict_stats_event */ +#include "dict0stats_bg.h" +#include "dict0stats_bg.h" +#include "btr0defragment.h" #include "srv0srv.h" #include "srv0start.h" #include "trx0sys.h" @@ -3618,6 +3619,8 @@ loop: thread_name = "lock_wait_timeout_thread"; } else if (srv_buf_dump_thread_active) { thread_name = "buf_dump_thread"; + } else if (btr_defragment_thread_active) { + thread_name = "btr_defragment_thread"; } else if (srv_fast_shutdown != 2 && trx_rollback_or_clean_is_active) { thread_name = "rollback of recovered transactions"; } else { diff --git a/storage/xtradb/srv/srv0srv.cc b/storage/xtradb/srv/srv0srv.cc index 8dbb7c3a498..5f16eca8531 100644 --- a/storage/xtradb/srv/srv0srv.cc +++ b/storage/xtradb/srv/srv0srv.cc @@ -1784,8 +1784,10 @@ srv_export_innodb_status(void) buf_get_total_stat(&stat); buf_get_total_list_len(&LRU_len, &free_len, &flush_list_len); buf_get_total_list_size_in_bytes(&buf_pools_list_size); - fil_crypt_total_stat(&crypt_stat); - btr_scrub_total_stat(&scrub_stat); + if (!srv_read_only_mode) { + fil_crypt_total_stat(&crypt_stat); + btr_scrub_total_stat(&scrub_stat); + } mem_adaptive_hash = 0; @@ -2099,6 +2101,7 @@ srv_export_innodb_status(void) export_vars.innodb_sec_rec_cluster_reads_avoided = srv_stats.n_sec_rec_cluster_reads_avoided; + if (!srv_read_only_mode) { export_vars.innodb_encryption_rotation_pages_read_from_cache = crypt_stat.pages_read_from_cache; export_vars.innodb_encryption_rotation_pages_read_from_disk = @@ -2126,6 +2129,7 @@ srv_export_innodb_status(void) scrub_stat.page_split_failures_missing_index; export_vars.innodb_scrub_page_split_failures_unknown = scrub_stat.page_split_failures_unknown; + } mutex_exit(&srv_innodb_monitor_mutex); } diff --git a/storage/xtradb/srv/srv0start.cc b/storage/xtradb/srv/srv0start.cc index 46fb0017a9a..5247e80da1f 100644 --- a/storage/xtradb/srv/srv0start.cc +++ b/storage/xtradb/srv/srv0start.cc @@ -3089,14 +3089,16 @@ files_checked: fil_system_enter(); fil_crypt_threads_init(); fil_system_exit(); + + /* Init data for datafile scrub threads */ + btr_scrub_init(); + + /* Initialize online defragmentation. */ + btr_defragment_init(); + btr_defragment_thread_active = true; + os_thread_create(btr_defragment_thread, NULL, NULL); } - /* Init data for datafile scrub threads */ - btr_scrub_init(); - - /* Initialize online defragmentation. */ - btr_defragment_init(); - srv_was_started = TRUE; return(DB_SUCCESS); @@ -3260,11 +3262,10 @@ innobase_shutdown_for_mysql(void) if (!srv_read_only_mode) { dict_stats_thread_deinit(); fil_crypt_threads_cleanup(); + btr_scrub_cleanup(); + btr_defragment_shutdown(); } - /* Cleanup data for datafile scrubbing */ - btr_scrub_cleanup(); - #ifdef __WIN__ /* MDEV-361: ha_innodb.dll leaks handles on Windows MDEV-7403: should not pass recv_writer_thread_handle to From 808f18c748a98dcc7df0b8154563153c8527d3f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Fri, 26 May 2017 19:13:21 +0300 Subject: [PATCH 17/17] MDEV-12926 encryption.innodb_onlinealter_encryption, encryption.innodb-bad-key-change failed in buildbot with valgrind row_merge_write(): Pass the correct (possibly encrypted) buffer to os_file_write_int_fd(). This bug was introduced in commit 65e1399e64a306f1ce1d920e66206954f8630da8 which included a commit to merge changes from MySQL 5.6.36 to MariaDB Server 10.0. --- storage/innobase/row/row0merge.cc | 2 +- storage/xtradb/row/row0merge.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index 85e053de961..45a8010d56d 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -1016,7 +1016,7 @@ row_merge_write( mach_write_to_4((byte *)out_buf, 0); } - ret = os_file_write_int_fd("(merge)", fd, buf, ofs, buf_len); + ret = os_file_write_int_fd("(merge)", fd, out_buf, ofs, buf_len); #ifdef UNIV_DEBUG if (row_merge_print_block_write) { diff --git a/storage/xtradb/row/row0merge.cc b/storage/xtradb/row/row0merge.cc index 16348f3c8dd..408e94b3997 100644 --- a/storage/xtradb/row/row0merge.cc +++ b/storage/xtradb/row/row0merge.cc @@ -1023,7 +1023,7 @@ row_merge_write( mach_write_to_4((byte *)out_buf, 0); } - ret = os_file_write_int_fd("(merge)", fd, buf, ofs, buf_len); + ret = os_file_write_int_fd("(merge)", fd, out_buf, ofs, buf_len); #ifdef UNIV_DEBUG if (row_merge_print_block_write) {