diff options
39 files changed, 193 insertions, 266 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 68785ccff8e..26fa275dacd 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -153,7 +153,7 @@ static struct my_option my_long_options[]= &opt_systables_only, &opt_systables_only, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0}, #define USER_OPT (array_elements(my_long_options) - 6) - {"user", 'u', "User for login if not current user.", &opt_user, + {"user", 'u', "User for login.", &opt_user, &opt_user, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, {"verbose", 'v', "Display more output about the process; Using it twice will print connection argument; Using it 3 times will print out all CHECK, RENAME and ALTER TABLE during the check phase.", &opt_not_used, &opt_not_used, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0, 0}, diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 17b847b3b5a..25d3256ca4e 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -466,17 +466,21 @@ sub mtr_report_stats ($$$$) { } $test_time = sprintf("%.3f", $test->{timer} / 1000); + $test->{'name'} =~ s/$current_suite\.//; $xml_report .= qq(\t\t<testcase assertions="" classname="$current_suite" name="$test->{'name'}" status="$test->{'result'}" time="$test_time"); my $comment = $test->{'comment'}; $comment =~ s/[\"]//g; - if ($test->{'result'} eq "MTR_RES_FAILED") { - $xml_report .= qq(>\n\t\t\t<failure message="" type="$test->{'result'}">\n<![CDATA[$test->{'logfile'}]]>\n\t\t\t</failure>\n\t\t</testcase>\n); + # if a test case has to be retried it should have the result MTR_RES_FAILED in jUnit XML + if ($test->{'result'} eq "MTR_RES_FAILED" || $test->{'retries'}) { + my $logcontents = $test->{'logfile-failed'} || $test->{'logfile'}; + + $xml_report .= qq(>\n\t\t\t<failure message="" type="MTR_RES_FAILED">\n<![CDATA[$logcontents]]>\n\t\t\t</failure>\n\t\t</testcase>\n); } elsif ($test->{'result'} eq "MTR_RES_SKIPPED" && $test->{'disable'}) { - $xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n); + $xml_report .= qq(>\n\t\t\t<disabled message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n); } elsif ($test->{'result'} eq "MTR_RES_SKIPPED") { - $xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="$test->{'result'}"/>\n\t\t</testcase>\n); + $xml_report .= qq(>\n\t\t\t<skipped message="$comment" type="MTR_RES_SKIPPED"/>\n\t\t</testcase>\n); } else { $xml_report .= " />\n"; } diff --git a/mysql-test/main/type_set.result b/mysql-test/main/type_set.result index ae72619b5ae..76a0c343973 100644 --- a/mysql-test/main/type_set.result +++ b/mysql-test/main/type_set.result @@ -109,7 +109,7 @@ End of 5.0 tests # Start of 10.0 tests # # -# MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns +# MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns # CREATE TABLE t1 (c1 DATE PRIMARY KEY); INSERT INTO t1 VALUES ('2001-01-01'); diff --git a/mysql-test/main/type_set.test b/mysql-test/main/type_set.test index 637ad40c316..8a81c406c63 100644 --- a/mysql-test/main/type_set.test +++ b/mysql-test/main/type_set.test @@ -102,7 +102,7 @@ DROP TABLE t1; --echo # --echo # ---echo # MDEV-6950 Bad results with joins compating DATE and INT/ENUM/VARCHAR columns +--echo # MDEV-6950 Bad results with joins comparing DATE and INT/ENUM/VARCHAR columns --echo # CREATE TABLE t1 (c1 DATE PRIMARY KEY); diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 489e84668b1..09990790c33 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -387,7 +387,7 @@ my $set_titlebar; }; eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }'; } else { - sub HAVE_WIN32_CONSOLE { 0 }; + eval 'sub HAVE_WIN32_CONSOLE { 0 }'; } } @@ -395,7 +395,7 @@ if (-t STDOUT) { if (IS_WINDOWS and HAVE_WIN32_CONSOLE) { $set_titlebar = sub {Win32::Console::Title $_[0];}; } elsif (defined $ENV{TERM} and $ENV{TERM} =~ /xterm/) { - $set_titlebar = sub { print "\e];$_[0]\a"; }; + $set_titlebar = sub { syswrite STDOUT, "\e];$_[0]\a"; }; } } @@ -946,6 +946,7 @@ sub run_test_server ($$$) { if ( $result->is_failed() ) { my $worker_logdir= $result->{savedir}; my $log_file_name=dirname($worker_logdir)."/".$result->{shortname}.".log"; + $result->{'logfile-failed'} = mtr_lastlinesfromfile($log_file_name, 20); rename $log_file_name,$log_file_name.".failed"; } delete($result->{result}); diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index a61d5776a5f..71ee059d6d3 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -11,8 +11,6 @@ ############################################################################## MW-286 : MDEV-18464 Killing thread can cause mutex deadlock if done concurrently with Galera/replication victim kill -MW-328A : MDEV-21483 galera.MW-328A galera.MW-328B -MW-328B : MDEV-21483 galera.MW-328A galera.MW-328B MW-329 : MDEV-19962 Galera test failure on MW-329 galera.galera_defaults : MDEV-21494 Galera test sporadic failure on galera.galera_defaults galera_as_slave_replication_bundle : MDEV-15785 OPTION_GTID_BEGIN is set in Gtid_log_event::do_apply_event() @@ -25,7 +23,6 @@ galera_parallel_simple : MDEV-20318 galera.galera_parallel_simple fails galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim galera_ssl_upgrade : MDEV-19950 Galera test failure on galera_ssl_upgrade galera_sst_mariabackup_encrypt_with_key : MDEV-21484 galera_sst_mariabackup_encrypt_with_key -galera_sst_mariabackup_table_options: MDEV-19741 Galera test failure on galera.galera_sst_mariabackup_table_options galera_var_innodb_disallow_writes : MDEV-20928 galera.galera_var_innodb_disallow_writes galera_var_node_address : MDEV-20485 Galera test failure galera_wan : MDEV-17259 Test failure on galera.galera_wan diff --git a/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result index d8a9f0d6f57..bea76e19dbb 100644 --- a/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result +++ b/mysql-test/suite/galera/r/galera_as_slave_gtid_myisam.result @@ -23,6 +23,9 @@ gtid_binlog_state_equal #cleanup connection node_1; DROP TABLE t1; +connection node_2; +connection node_3; +connection node_1; reset master; connection node_2; STOP SLAVE; diff --git a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result index ca388496794..3ba34e8ea79 100644 --- a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result +++ b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result @@ -1,37 +1,38 @@ -SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -VARIABLE_VALUE = 'Primary' -1 -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -VARIABLE_VALUE = 'ON' -1 -SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -VARIABLE_VALUE = 0 -1 -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -VARIABLE_VALUE = 'ON' -1 -SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -VARIABLE_VALUE = 4 -1 -SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -VARIABLE_VALUE = 'Synced' -1 +connection node_1; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +VARIABLE_VALUE +Primary +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; +VARIABLE_VALUE +ON +SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; +(VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) +1 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +VARIABLE_VALUE +ON +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; +VARIABLE_VALUE +4 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; +VARIABLE_VALUE +Synced connection node_2; -SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -VARIABLE_VALUE = 'Primary' -1 -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -VARIABLE_VALUE = 'ON' -1 -SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -VARIABLE_VALUE = 0 -1 -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -VARIABLE_VALUE = 'ON' -1 -SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -VARIABLE_VALUE = 4 -1 -SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; -VARIABLE_VALUE = 'Synced' -1 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +VARIABLE_VALUE +Primary +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; +VARIABLE_VALUE +ON +SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; +(VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) +1 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +VARIABLE_VALUE +ON +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; +VARIABLE_VALUE +4 +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; +VARIABLE_VALUE +Synced diff --git a/mysql-test/suite/galera/suite.pm b/mysql-test/suite/galera/suite.pm index f3c04979705..96580150c7d 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -65,6 +65,7 @@ push @::global_suppressions, qr|WSREP: JOIN message from member .* in non-primary configuration. Ignored.|, qr(WSREP: Failed to remove page file .*), qr(WSREP: wsrep_sst_method is set to 'mysqldump' yet mysqld bind_address is set to .*), + qr(WSREP: .*Transport endpoint is not connected.*), ); bless { }; diff --git a/mysql-test/suite/galera/t/MW-328A.cnf b/mysql-test/suite/galera/t/MW-328A.cnf new file mode 100644 index 00000000000..a10ea88bdf2 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328A.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep-debug=ON + +[mysqld.2] +wsrep-debug=ON diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test index dd692a292b8..a547823ced0 100644 --- a/mysql-test/suite/galera/t/MW-328A.test +++ b/mysql-test/suite/galera/t/MW-328A.test @@ -13,7 +13,7 @@ # --source include/galera_cluster.inc ---source include/big_test.inc +--source include/force_restart.inc --source suite/galera/t/MW-328-header.inc --connection node_2 diff --git a/mysql-test/suite/galera/t/MW-328B.cnf b/mysql-test/suite/galera/t/MW-328B.cnf new file mode 100644 index 00000000000..a10ea88bdf2 --- /dev/null +++ b/mysql-test/suite/galera/t/MW-328B.cnf @@ -0,0 +1,7 @@ +!include ../galera_2nodes.cnf + +[mysqld.1] +wsrep-debug=ON + +[mysqld.2] +wsrep-debug=ON diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test index 04503ce31e3..41581d9c239 100644 --- a/mysql-test/suite/galera/t/MW-328B.test +++ b/mysql-test/suite/galera/t/MW-328B.test @@ -8,7 +8,7 @@ # --source include/galera_cluster.inc ---source include/big_test.inc +--source include/force_restart.inc --source suite/galera/t/MW-328-header.inc --connection node_2 diff --git a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test index 33668da11be..3710e6d65be 100644 --- a/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test +++ b/mysql-test/suite/galera/t/galera_as_slave_gtid_myisam.test @@ -55,6 +55,16 @@ SELECT COUNT(*) = 0 FROM t1; --echo #cleanup --connection node_1 DROP TABLE t1; + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; +--source include/wait_condition.inc + +--connection node_1 reset master; --connection node_2 diff --git a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test index 59350222a4c..422759ece59 100644 --- a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test +++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test @@ -7,44 +7,34 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--connection node_1 + --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; --source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 'on' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; ---source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; ---source include/wait_condition.inc --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; --source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; ---source include/wait_condition.inc --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; --source include/wait_condition.inc -SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; +SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; --connection node_2 --let $wait_condition = SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; --source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 'on' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; ---source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; ---source include/wait_condition.inc --let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; --source include/wait_condition.inc ---let $wait_condition = SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; ---source include/wait_condition.inc --let $wait_condition = SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; --source include/wait_condition.inc -SELECT VARIABLE_VALUE = 'Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; -SELECT VARIABLE_VALUE = 0 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; -SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; -SELECT VARIABLE_VALUE = 4 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; -SELECT VARIABLE_VALUE = 'Synced' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_connected'; +SELECT (VARIABLE_VALUE = 0 OR VARIABLE_VALUE = 1 ) FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_index'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state'; +SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_comment'; diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index fe57528fa13..64b79af51df 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -496,7 +496,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE INT UNSIGNED VARIABLE_COMMENT InnoDB system tablespace size to be set in recovery. NUMERIC_MIN_VALUE 0 -NUMERIC_MAX_VALUE 4294967295 +NUMERIC_MAX_VALUE 268435456 NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY YES diff --git a/mysys/list.c b/mysys/list.c index 10dfd7ec6ef..65da5d452cc 100644 --- a/mysys/list.c +++ b/mysys/list.c @@ -14,7 +14,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1335 USA */ /* - Code for handling dubble-linked lists in C + Code for handling doubly linked lists in C */ #include "mysys_priv.h" @@ -22,7 +22,7 @@ - /* Add a element to start of list */ + /* Add an element to start of list */ LIST *list_add(LIST *root, LIST *element) { diff --git a/sql/sql_admin.cc b/sql/sql_admin.cc index 92e88a74217..692ae7b00fa 100644 --- a/sql/sql_admin.cc +++ b/sql/sql_admin.cc @@ -772,31 +772,6 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, (table->table->s->table_category == TABLE_CATEGORY_USER && (get_use_stat_tables_mode(thd) > NEVER || lex->with_persistent_for_clause)); - - - if (!lex->index_list) - { - tab->keys_in_use_for_query.init(tab->s->keys); - } - else - { - int pos; - LEX_STRING *index_name; - List_iterator_fast<LEX_STRING> it(*lex->index_list); - - tab->keys_in_use_for_query.clear_all(); - while ((index_name= it++)) - { - if (tab->s->keynames.type_names == 0 || - (pos= find_type(&tab->s->keynames, index_name->str, - index_name->length, 1)) <= 0) - { - compl_result_code= result_code= HA_ADMIN_INVALID; - break; - } - tab->keys_in_use_for_query.set_bit(--pos); - } - } } if (result_code == HA_ADMIN_OK) @@ -881,6 +856,27 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables, } tab->file->column_bitmaps_signal(); } + if (!lex->index_list) + tab->keys_in_use_for_query.init(tab->s->keys); + else + { + int pos; + LEX_STRING *index_name; + List_iterator_fast<LEX_STRING> it(*lex->index_list); + + tab->keys_in_use_for_query.clear_all(); + while ((index_name= it++)) + { + if (tab->s->keynames.type_names == 0 || + (pos= find_type(&tab->s->keynames, index_name->str, + index_name->length, 1)) <= 0) + { + compl_result_code= result_code= HA_ADMIN_INVALID; + break; + } + tab->keys_in_use_for_query.set_bit(--pos); + } + } if (!(compl_result_code= alloc_statistics_for_table(thd, table->table)) && !(compl_result_code= diff --git a/sql/sql_class.cc b/sql/sql_class.cc index 9c206a7fa18..f958e17a9f2 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4786,6 +4786,7 @@ extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd) @param buflen Length of the buffer @return Length of the query + @retval 0 if LOCK_thd_data cannot be acquired without waiting @note This function is thread safe as the query string is accessed under mutex protection and the string is copied @@ -4794,10 +4795,19 @@ extern "C" LEX_STRING * thd_query_string (MYSQL_THD thd) extern "C" size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen) { - mysql_mutex_lock(&thd->LOCK_thd_data); - size_t len= MY_MIN(buflen - 1, thd->query_length()); - memcpy(buf, thd->query(), len); - mysql_mutex_unlock(&thd->LOCK_thd_data); + size_t len= 0; + /* InnoDB invokes this function while holding internal mutexes. + THD::awake() will hold LOCK_thd_data while invoking an InnoDB + function that would acquire the internal mutex. Because this + function is a non-essential part of information_schema view output, + we will break the deadlock by avoiding a mutex wait here + and returning the empty string if a wait would be needed. */ + if (!mysql_mutex_trylock(&thd->LOCK_thd_data)) + { + len= MY_MIN(buflen - 1, thd->query_length()); + memcpy(buf, thd->query(), len); + mysql_mutex_unlock(&thd->LOCK_thd_data); + } buf[len]= '\0'; return len; } diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index ef1efdf6efa..782d0334c7b 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1694,10 +1694,9 @@ retry_page_get: node_seq_t root_seq_no; root_seq_no = page_get_ssn_id(page); - - mutex_enter(&(index->rtr_ssn.mutex)); - index->rtr_ssn.seq_no = root_seq_no + 1; - mutex_exit(&(index->rtr_ssn.mutex)); + my_atomic_store32_explicit( + &index->rtr_ssn, root_seq_no + 1, + MY_MEMORY_ORDER_RELAXED); } /* Save the MBR */ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index f37411f17a7..162f297de5f 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -547,13 +547,13 @@ decompress: decompress_with_slot: ut_d(fil_page_type_validate(dst_frame)); - bpage->write_size = fil_page_decompress(slot->crypt_buf, - dst_frame); + ulint write_size = fil_page_decompress(slot->crypt_buf, + dst_frame); slot->release(); - ut_ad(!bpage->write_size || fil_page_type_validate(dst_frame)); + ut_ad(!write_size || fil_page_type_validate(dst_frame)); ut_ad(space->pending_io()); - return bpage->write_size != 0; + return write_size != 0; } if (space->crypt_data @@ -1542,7 +1542,6 @@ buf_block_init( block->page.io_fix = BUF_IO_NONE; block->page.flush_observer = NULL; block->page.real_size = 0; - block->page.write_size = 0; block->modify_clock = 0; block->page.slot = NULL; @@ -5290,7 +5289,6 @@ buf_page_init_low( bpage->access_time = 0; bpage->newest_modification = 0; bpage->oldest_modification = 0; - bpage->write_size = 0; bpage->real_size = 0; bpage->slot = NULL; diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index a0f2b5f3972..e0ef13235a8 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -4881,7 +4881,7 @@ dict_create_foreign_constraints( heap = mem_heap_create(10000); err = dict_create_foreign_constraints_low( - trx, heap, innobase_get_charset(trx->mysql_thd), + trx, heap, thd_charset(trx->mysql_thd), str, name, reject_fks); mem_heap_free(heap); @@ -4916,7 +4916,7 @@ dict_foreign_parse_drop_constraints( ut_a(trx->mysql_thd); - cs = innobase_get_charset(trx->mysql_thd); + cs = thd_charset(trx->mysql_thd); *n = 0; diff --git a/storage/innobase/dict/dict0mem.cc b/storage/innobase/dict/dict0mem.cc index 8c28892b234..5aea4678ab8 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -774,7 +774,6 @@ dict_mem_index_create( dict_index_zip_pad_mutex_create_lazy(index); if (type & DICT_SPATIAL) { - mutex_create(LATCH_ID_RTR_SSN_MUTEX, &index->rtr_ssn.mutex); index->rtr_track = static_cast<rtr_info_track_t*>( mem_heap_alloc( heap, @@ -1100,7 +1099,6 @@ dict_mem_index_free( rtr_info->index = NULL; } - mutex_destroy(&index->rtr_ssn.mutex); mutex_destroy(&index->rtr_track->rtr_active_mutex); UT_DELETE(index->rtr_track->rtr_active); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 7d93f2915c6..3785e4eb299 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -649,7 +649,6 @@ static PSI_mutex_info all_innodb_mutexes[] = { PSI_KEY(rtr_active_mutex), PSI_KEY(rtr_match_mutex), PSI_KEY(rtr_path_mutex), - PSI_KEY(rtr_ssn_mutex), PSI_KEY(trx_sys_mutex), PSI_KEY(zip_pad_mutex) }; @@ -2247,17 +2246,6 @@ innobase_casedn_str( my_casedn_str(system_charset_info, a); } -/**********************************************************************//** -Determines the connection character set. -@return connection character set */ -CHARSET_INFO* -innobase_get_charset( -/*=================*/ - THD* mysql_thd) /*!< in: MySQL thread handle */ -{ - return(thd_charset(mysql_thd)); -} - /** Determines the current SQL statement. Thread unsafe, can only be called from the thread owning the THD. @param[in] thd MySQL thread handle @@ -2277,22 +2265,6 @@ innobase_get_stmt_unsafe( return NULL; } -/** Determines the current SQL statement. -Thread safe, can be called from any thread as the string is copied -into the provided buffer. -@param[in] thd MySQL thread handle -@param[out] buf Buffer containing SQL statement -@param[in] buflen Length of provided buffer -@return Length of the SQL statement */ -size_t -innobase_get_stmt_safe( - THD* thd, - char* buf, - size_t buflen) -{ - return thd_query_safe(thd, buf, buflen); -} - /**********************************************************************//** Get the current setting of the tdc_size global parameter. We do a dirty read because for one there is no synchronization object and @@ -20151,7 +20123,7 @@ static MYSQL_SYSVAR_UINT(data_file_size_debug, srv_sys_space_size_debug, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, "InnoDB system tablespace size to be set in recovery.", - NULL, NULL, 0, 0, UINT_MAX32, 0); + NULL, NULL, 0, 0, 256U << 20, 0); static MYSQL_SYSVAR_ULONG(fil_make_page_dirty_debug, srv_fil_make_page_dirty_debug, PLUGIN_VAR_OPCMDARG, diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 58b332c758d..56b70d816c6 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -513,13 +513,8 @@ the definitions are bracketed with #ifdef INNODB_COMPATIBILITY_HOOKS */ #error InnoDB needs MySQL to be built with #define INNODB_COMPATIBILITY_HOOKS #endif -LEX_STRING* thd_query_string(MYSQL_THD thd); -size_t thd_query_safe(MYSQL_THD thd, char *buf, size_t buflen); - extern "C" { -struct charset_info_st *thd_charset(MYSQL_THD thd); - /** Check if a user thread is a replication slave thread @param thd user thread @retval 0 the user thread is not a replication slave thread diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc index ec54592605d..f6af27a0463 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1997, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2016, 2020 MariaDB Corporation. +Copyright (c) 2016, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2737,42 +2737,28 @@ ibuf_contract_after_insert( } while (size > 0 && sum_sizes < entry_size); } -/*********************************************************************//** -Determine if an insert buffer record has been encountered already. -@return TRUE if a new record, FALSE if possible duplicate */ -static -ibool -ibuf_get_volume_buffered_hash( -/*==========================*/ - const rec_t* rec, /*!< in: ibuf record in post-4.1 format */ - const byte* types, /*!< in: fields */ - const byte* data, /*!< in: start of user record data */ - ulint comp, /*!< in: 0=ROW_FORMAT=REDUNDANT, - nonzero=ROW_FORMAT=COMPACT */ - ulint* hash, /*!< in/out: hash array */ - ulint size) /*!< in: number of elements in hash array */ +/** Determine if a change buffer record has been encountered already. +@param rec change buffer record in the MySQL 5.5 format +@param hash hash table of encountered records +@param size number of elements in hash +@retval true if a distinct record +@retval false if this may be duplicating an earlier record */ +static bool ibuf_get_volume_buffered_hash(const rec_t *rec, ulint *hash, + ulint size) { - ulint len; - ulint fold; - ulint bitmask; - - len = ibuf_rec_get_size( - rec, types, - rec_get_n_fields_old(rec) - IBUF_REC_FIELD_USER, comp); - fold = ut_fold_binary(data, len); - - hash += (fold / (CHAR_BIT * sizeof *hash)) % size; - bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash))); - - if (*hash & bitmask) { - - return(FALSE); - } - - /* We have not seen this record yet. Insert it. */ - *hash |= bitmask; - - return(TRUE); + ut_ad(rec_get_n_fields_old(rec) > IBUF_REC_FIELD_USER); + const ulint start= rec_get_field_start_offs(rec, IBUF_REC_FIELD_USER); + const ulint len= rec_get_data_size_old(rec) - start; + const uint32_t fold= ut_crc32(rec + start, len); + hash+= (fold / (CHAR_BIT * sizeof *hash)) % size; + ulint bitmask= static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash))); + + if (*hash & bitmask) + return false; + + /* We have not seen this record yet. Remember it. */ + *hash|= bitmask; + return true; } #ifdef UNIV_DEBUG @@ -2865,11 +2851,7 @@ ibuf_get_volume_buffered_count_func( case IBUF_OP_DELETE_MARK: /* There must be a record to delete-mark. See if this record has been already buffered. */ - if (n_recs && ibuf_get_volume_buffered_hash( - rec, types + IBUF_REC_INFO_SIZE, - types + len, - types[IBUF_REC_OFFSET_FLAGS] & IBUF_REC_COMPACT, - hash, size)) { + if (n_recs && ibuf_get_volume_buffered_hash(rec, hash, size)) { (*n_recs)++; } diff --git a/storage/innobase/include/buf0buf.h b/storage/innobase/include/buf0buf.h index 6bf2dc2f1c4..f392b7cff0b 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2013, 2020 MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -1508,11 +1508,6 @@ public: zip.data == NULL means an active buf_pool->watch */ - ulint write_size; /* Write size is set when this - page is first time written and then - if written again we check is TRIM - operation needed. */ - ulint real_size; /*!< Real size of the page Normal pages == srv_page_size page compressed pages, payload diff --git a/storage/innobase/include/dict0mem.h b/storage/innobase/include/dict0mem.h index c967600a240..4b615b8d95c 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -2,7 +2,7 @@ Copyright (c) 1996, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2012, Facebook Inc. -Copyright (c) 2013, 2019, MariaDB Corporation. +Copyright (c) 2013, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -983,7 +983,8 @@ struct dict_index_t{ /* in which slot the next sample should be saved. */ /* @} */ - rtr_ssn_t rtr_ssn;/*!< Node sequence number for RTree */ + /** R-tree split sequence number */ + volatile int32 rtr_ssn; rtr_info_track_t* rtr_track;/*!< tracking all R-Tree search cursors */ trx_id_t trx_id; /*!< id of the transaction that created this diff --git a/storage/innobase/include/gis0rtree.ic b/storage/innobase/include/gis0rtree.ic index f01bc3fc9c9..a22164931b2 100644 --- a/storage/innobase/include/gis0rtree.ic +++ b/storage/innobase/include/gis0rtree.ic @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -132,13 +132,9 @@ rtr_get_new_ssn_id( /*===============*/ dict_index_t* index) /*!< in/out: the index struct */ { - node_seq_t ssn; - - mutex_enter(&(index->rtr_ssn.mutex)); - ssn = ++index->rtr_ssn.seq_no; - mutex_exit(&(index->rtr_ssn.mutex)); - - return(ssn); + node_seq_t ssn= my_atomic_add32_explicit(&index->rtr_ssn, 1, + MY_MEMORY_ORDER_RELAXED); + return ssn + 1; } /*****************************************************************//** Get the current Split Sequence Number. @@ -149,13 +145,7 @@ rtr_get_current_ssn_id( /*===================*/ dict_index_t* index) /*!< in: index struct */ { - node_seq_t ssn; - - mutex_enter(&(index->rtr_ssn.mutex)); - ssn = index->rtr_ssn.seq_no; - mutex_exit(&(index->rtr_ssn.mutex)); - - return(ssn); + return my_atomic_load32_explicit(&index->rtr_ssn, MY_MEMORY_ORDER_RELAXED); } /*********************************************************************//** diff --git a/storage/innobase/include/gis0type.h b/storage/innobase/include/gis0type.h index ee350ea56ce..c5ea817c6bf 100644 --- a/storage/innobase/include/gis0type.h +++ b/storage/innobase/include/gis0type.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2014, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2018, MariaDB Corporation. +Copyright (c) 2018, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -143,12 +143,6 @@ typedef struct rtr_info_track { rtr_active */ } rtr_info_track_t; -/* Node Sequence Number and mutex protects it. */ -typedef struct rtree_ssn { - ib_mutex_t mutex; /*!< mutex protect the seq num */ - node_seq_t seq_no; /*!< the SSN (node sequence number) */ -} rtr_ssn_t; - /* This is to record the record movement between pages. Used for corresponding lock movement */ typedef struct rtr_rec_move { diff --git a/storage/innobase/include/ha_prototypes.h b/storage/innobase/include/ha_prototypes.h index e3eb02d2fbf..51a34b91418 100644 --- a/storage/innobase/include/ha_prototypes.h +++ b/storage/innobase/include/ha_prototypes.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2006, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2019, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -241,13 +241,7 @@ ulint wsrep_innobase_mysql_sort(int mysql_type, uint charset_number, unsigned int buf_length); #endif /* WITH_WSREP */ -/**********************************************************************//** -Determines the connection character set. -@return connection character set */ -CHARSET_INFO* -innobase_get_charset( -/*=================*/ - THD* thd); /*!< in: MySQL thread handle */ +extern "C" struct charset_info_st *thd_charset(THD *thd); /** Determines the current SQL statement. Thread unsafe, can only be called from the thread owning the THD. @@ -259,19 +253,6 @@ innobase_get_stmt_unsafe( THD* thd, size_t* length); -/** Determines the current SQL statement. -Thread safe, can be called from any thread as the string is copied -into the provided buffer. -@param[in] thd MySQL thread handle -@param[out] buf Buffer containing SQL statement -@param[in] buflen Length of provided buffer -@return Length of the SQL statement */ -size_t -innobase_get_stmt_safe( - THD* thd, - char* buf, - size_t buflen); - /******************************************************************//** This function is used to find the storage length in bytes of the first n characters for prefix indexes using a multibyte character set. The function diff --git a/storage/innobase/include/page0page.ic b/storage/innobase/include/page0page.ic index 8c9dc433669..d1bf382c1d5 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -173,9 +173,6 @@ page_header_set_field( { ut_ad(page); ut_ad(field <= PAGE_N_RECS); -#if 0 /* FIXME: MDEV-19344 hits this */ - ut_ad(field != PAGE_N_RECS || val); -#endif ut_ad(field == PAGE_N_HEAP || val < srv_page_size); ut_ad(field != PAGE_N_HEAP || (val & 0x7fff) < srv_page_size); diff --git a/storage/innobase/include/sync0sync.h b/storage/innobase/include/sync0sync.h index 5562b54c296..ddbfa451d22 100644 --- a/storage/innobase/include/sync0sync.h +++ b/storage/innobase/include/sync0sync.h @@ -3,6 +3,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. Copyright (c) 2012, Facebook Inc. +Copyright (c) 2020, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -80,7 +81,6 @@ extern mysql_pfs_key_t recv_writer_mutex_key; extern mysql_pfs_key_t rtr_active_mutex_key; extern mysql_pfs_key_t rtr_match_mutex_key; extern mysql_pfs_key_t rtr_path_mutex_key; -extern mysql_pfs_key_t rtr_ssn_mutex_key; extern mysql_pfs_key_t redo_rseg_mutex_key; extern mysql_pfs_key_t noredo_rseg_mutex_key; extern mysql_pfs_key_t page_zip_stat_per_index_mutex_key; diff --git a/storage/innobase/include/sync0types.h b/storage/innobase/include/sync0types.h index 12936c04b70..8fcb1abb0e2 100644 --- a/storage/innobase/include/sync0types.h +++ b/storage/innobase/include/sync0types.h @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -315,7 +315,6 @@ enum latch_id_t { LATCH_ID_REDO_RSEG, LATCH_ID_NOREDO_RSEG, LATCH_ID_RW_LOCK_DEBUG, - LATCH_ID_RTR_SSN_MUTEX, LATCH_ID_RTR_ACTIVE_MUTEX, LATCH_ID_RTR_MATCH_MUTEX, LATCH_ID_RTR_PATH_MUTEX, diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index c61ba742ff5..65593ad745a 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1676,7 +1676,7 @@ wait_suspend_loop: "Waiting for %s to exit", thread_name); if (srv_print_verbose_log && count > COUNT_INTERVAL) { ib::info() << "Waiting for " << thread_name - << "to exit"; + << " to exit"; count = 0; } goto loop; diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index 2f1238d5361..4470ecc5e23 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2538,11 +2538,15 @@ void innodb_shutdown() ut_ad(!srv_undo_sources); switch (srv_operation) { + case SRV_OPERATION_RESTORE_ROLLBACK_XA: + if (dberr_t err = fil_write_flushed_lsn(log_sys.lsn)) + ib::error() << "Writing flushed lsn " << log_sys.lsn + << " failed; error=" << err; + /* fall through */ case SRV_OPERATION_BACKUP: case SRV_OPERATION_RESTORE: case SRV_OPERATION_RESTORE_DELTA: case SRV_OPERATION_RESTORE_EXPORT: - case SRV_OPERATION_RESTORE_ROLLBACK_XA: fil_close_all_files(); break; case SRV_OPERATION_NORMAL: diff --git a/storage/innobase/sync/sync0debug.cc b/storage/innobase/sync/sync0debug.cc index b4bfde46b8f..d1ebcd52df3 100644 --- a/storage/innobase/sync/sync0debug.cc +++ b/storage/innobase/sync/sync0debug.cc @@ -1,7 +1,7 @@ /***************************************************************************** Copyright (c) 2014, 2016, Oracle and/or its affiliates. All Rights Reserved. -Copyright (c) 2017, 2018, MariaDB Corporation. +Copyright (c) 2017, 2020, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -384,8 +384,7 @@ private: { return(latch->get_id() == LATCH_ID_RTR_ACTIVE_MUTEX || latch->get_id() == LATCH_ID_RTR_PATH_MUTEX - || latch->get_id() == LATCH_ID_RTR_MATCH_MUTEX - || latch->get_id() == LATCH_ID_RTR_SSN_MUTEX); + || latch->get_id() == LATCH_ID_RTR_MATCH_MUTEX); } private: @@ -1361,8 +1360,6 @@ sync_latch_meta_init() rw_lock_debug_mutex_key); #endif /* UNIV_DEBUG */ - LATCH_ADD_MUTEX(RTR_SSN_MUTEX, SYNC_ANY_LATCH, rtr_ssn_mutex_key); - LATCH_ADD_MUTEX(RTR_ACTIVE_MUTEX, SYNC_ANY_LATCH, rtr_active_mutex_key); diff --git a/storage/innobase/sync/sync0sync.cc b/storage/innobase/sync/sync0sync.cc index 6b293fb55f1..c52064c7bb9 100644 --- a/storage/innobase/sync/sync0sync.cc +++ b/storage/innobase/sync/sync0sync.cc @@ -2,6 +2,7 @@ Copyright (c) 1995, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 2008, Google Inc. +Copyright (c) 2020, MariaDB Corporation. Portions of this file contain modifications contributed and copyrighted by Google, Inc. Those modifications are gratefully acknowledged and are described @@ -72,7 +73,6 @@ mysql_pfs_key_t rw_lock_debug_mutex_key; mysql_pfs_key_t rtr_active_mutex_key; mysql_pfs_key_t rtr_match_mutex_key; mysql_pfs_key_t rtr_path_mutex_key; -mysql_pfs_key_t rtr_ssn_mutex_key; mysql_pfs_key_t rw_lock_list_mutex_key; mysql_pfs_key_t rw_lock_mutex_key; mysql_pfs_key_t srv_innodb_monitor_mutex_key; diff --git a/storage/innobase/trx/trx0i_s.cc b/storage/innobase/trx/trx0i_s.cc index c05a5a5ab39..54425ae934b 100644 --- a/storage/innobase/trx/trx0i_s.cc +++ b/storage/innobase/trx/trx0i_s.cc @@ -46,6 +46,7 @@ Created July 17, 2007 Vasil Dimov #include "trx0sys.h" #include "que0que.h" #include "trx0purge.h" +#include "sql_class.h" /** Initial number of rows in the table cache */ #define TABLE_CACHE_INITIAL_ROWSNUM 1024 @@ -450,7 +451,6 @@ fill_trx_row( which to copy volatile strings */ { - size_t stmt_len; const char* s; ut_ad(lock_mutex_own()); @@ -485,16 +485,14 @@ fill_trx_row( row->trx_mysql_thread_id = thd_get_thread_id(trx->mysql_thd); char query[TRX_I_S_TRX_QUERY_MAX_LEN + 1]; - stmt_len = innobase_get_stmt_safe(trx->mysql_thd, query, sizeof(query)); - - if (stmt_len > 0) { - + if (size_t stmt_len = thd_query_safe(trx->mysql_thd, query, + sizeof query)) { row->trx_query = static_cast<const char*>( ha_storage_put_memlim( cache->storage, query, stmt_len + 1, MAX_ALLOWED_FOR_STORAGE(cache))); - row->trx_query_cs = innobase_get_charset(trx->mysql_thd); + row->trx_query_cs = thd_charset(trx->mysql_thd); if (row->trx_query == NULL) { |