diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-13 12:52:57 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-05-13 12:52:57 +0300 |
commit | 38f6c47f8a0a9bc313e4875c4676985249771c76 (patch) | |
tree | 0cb876cdf2ead314e2fad565c9d71550cc40b412 | |
parent | 9f20968169e21fcf8941041a8a7ce06013a79bd9 (diff) | |
parent | 15fa70b8408a2146b300a4e1b19819addafa5929 (diff) | |
download | mariadb-git-38f6c47f8a0a9bc313e4875c4676985249771c76.tar.gz |
Merge 10.3 into 10.4
44 files changed, 212 insertions, 309 deletions
diff --git a/client/mysql_upgrade.c b/client/mysql_upgrade.c index 8c4a0f0a18e..aa73680a3df 100644 --- a/client/mysql_upgrade.c +++ b/client/mysql_upgrade.c @@ -148,7 +148,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/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 8bd25a43f3c..93b61730a03 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -15097,6 +15097,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "outer_ref_condition": "t1.a is not null", @@ -15203,6 +15204,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "outer_ref_condition": "t1.a is not null", @@ -15402,6 +15404,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "outer_ref_condition": "t3.a is not null and t3.c is not null", @@ -15554,6 +15557,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "outer_ref_condition": "t3.a is not null and t3.c is not null", @@ -15729,6 +15733,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "outer_ref_condition": "t3.c is not null", @@ -15976,6 +15981,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "outer_ref_condition": "t3.c is not null", @@ -16464,6 +16470,7 @@ EXPLAIN "filtered": 100, "first_match": "t4", "materialized": { + "lateral": 1, "query_block": { "select_id": 3, "const_condition": "1", @@ -16610,6 +16617,7 @@ EXPLAIN "rows": 2, "filtered": 100, "materialized": { + "lateral": 1, "query_block": { "select_id": 2, "table": { 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 6b6f0285100..b2abae564a7 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -386,7 +386,7 @@ my $set_titlebar; }; eval 'sub HAVE_WIN32_CONSOLE { $have_win32_console }'; } else { - sub HAVE_WIN32_CONSOLE { 0 }; + eval 'sub HAVE_WIN32_CONSOLE { 0 }'; } } @@ -394,7 +394,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"; }; } } @@ -780,6 +780,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 99e3012d947..e1868260af1 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -38,7 +38,6 @@ galera_shutdown_nonprim : MDEV-21493 galera.galera_shutdown_nonprim galera_split_brain : MDEV-18280 Galera test failure on galera_split_brain and galera_kill_nochanges 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_toi_ddl_nonconflicting : MDEV-21518 galera.galera_toi_ddl_nonconflicting galera_var_innodb_disallow_writes : MDEV-20928 galera.galera_var_innodb_disallow_writes galera_var_node_address : MDEV-20485 Galera test failure @@ -46,7 +45,6 @@ galera_var_notify_cmd : MDEV-21905 Galera test galera_var_notify_cmd causes hang galera_var_reject_queries : assertion in inline_mysql_socket_send galera_var_retry_autocommit: MDEV-18181 Galera test failure on galera.galera_var_retry_autocommit galera_wan : MDEV-17259 Test failure on galera.galera_wan -galera_wsrep_new_cluster : MDEV-21515 galera.galera_wsrep_new_cluster mysql-wsrep#198 : MDEV-18935 Galera test mysql-wsrep#198 sporaric assertion transaction.cpp:362: int wsrep::transaction::before_commit(): Assertion `state() == s_executing || state() == s_committing || state() == s_must_abort || state() == s_replaying' failed. lp1376747-4 : MDEV-21911 Galera test failure on lp1376747-4 partition : MDEV-19958 Galera test failure on galera.partition 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 eee1da5828f..7e8da675ad4 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 @@ -31,6 +31,7 @@ DROP TABLE t1; connection node_1; connection node_2; connection node_3; +connection node_3; RESET MASTER; connection node_1; 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 8edf1a02e9d..244623d52b7 100644 --- a/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result +++ b/mysql-test/suite/galera/r/galera_wsrep_new_cluster.result @@ -1,39 +1,40 @@ connection node_2; connection node_1; -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 447c2b79d2b..4dd11f5d7a4 100644 --- a/mysql-test/suite/galera/suite.pm +++ b/mysql-test/suite/galera/suite.pm @@ -62,6 +62,7 @@ push @::global_suppressions, qr(WSREP: Ignoring error*), 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.*), ); sub skip_combinations { 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 ff85e8ab62e..004f5c825bb 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 @@ -68,6 +68,10 @@ DROP TABLE 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_3 RESET MASTER; --connection node_1 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 0df9f0f88df..84b6c032fc6 100644 --- a/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test +++ b/mysql-test/suite/galera/t/galera_wsrep_new_cluster.test @@ -6,44 +6,34 @@ --source include/galera_cluster.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 41db90a4464..4b8d3b3e60f 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 6fdbc14a372..9f28f6524d9 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 && (check_eits_collection_allowed(thd) || 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 2a805605faa..8f3bfde6da8 100644 --- a/sql/sql_class.cc +++ b/sql/sql_class.cc @@ -4854,6 +4854,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 @@ -4862,10 +4863,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/sql/sql_explain.cc b/sql/sql_explain.cc index d3b85638898..645c1618a8a 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -1883,6 +1883,11 @@ void Explain_table_access::print_explain_json(Explain_query *query, /* This is a derived table. Print its contents here */ writer->add_member("materialized").start_object(); Explain_node *node= query->get_node(derived_select_number); + if (node->get_type() == Explain_node::EXPLAIN_SELECT && + ((Explain_select*)node)->is_lateral) + { + writer->add_member("lateral").add_ll(1); + } node->print_explain_json(query, writer, is_analyze); writer->end_object(); } diff --git a/sql/sql_explain.h b/sql/sql_explain.h index 3896636f9fd..ce3f3ef06e1 100644 --- a/sql/sql_explain.h +++ b/sql/sql_explain.h @@ -211,6 +211,7 @@ public: select_lex(NULL), #endif linkage(UNSPECIFIED_TYPE), + is_lateral(false), message(NULL), having(NULL), having_value(Item::COND_UNDEF), using_temporary(false), using_filesort(false), @@ -226,6 +227,7 @@ public: #endif const char *select_type; enum sub_select_type linkage; + bool is_lateral; /* If message != NULL, this is a degenerate join plan, and all subsequent diff --git a/sql/sql_select.cc b/sql/sql_select.cc index b8173ab036c..4f006bf25a9 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2000, 2016, Oracle and/or its affiliates. - Copyright (c) 2009, 2019, MariaDB Corporation. + Copyright (c) 2009, 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 @@ -26744,6 +26744,8 @@ int JOIN::save_explain_data_intern(Explain_query *output, xpl_sel->select_id= join->select_lex->select_number; xpl_sel->select_type= join->select_lex->type; xpl_sel->linkage= select_lex->get_linkage(); + xpl_sel->is_lateral= ((select_lex->get_linkage() == DERIVED_TABLE_TYPE) && + (select_lex->uncacheable & UNCACHEABLE_DEPENDENT)); if (select_lex->master_unit()->derived) xpl_sel->connection_type= Explain_node::EXPLAIN_NODE_DERIVED; diff --git a/storage/innobase/btr/btr0cur.cc b/storage/innobase/btr/btr0cur.cc index ac9b055ad92..5a9c953cfba 100644 --- a/storage/innobase/btr/btr0cur.cc +++ b/storage/innobase/btr/btr0cur.cc @@ -1821,18 +1821,11 @@ retry_page_get: if (dict_index_is_spatial(index)) { ut_ad(cursor->rtr_info); - node_seq_t seq_no = rtr_get_current_ssn_id(index); - /* If SSN in memory is not initialized, fetch it from root page */ - if (seq_no < 1) { - 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)); + if (!rtr_get_current_ssn_id(index)) { + /* FIXME: do this in dict_load_table_one() */ + index->set_ssn(page_get_ssn_id(page) + 1); } /* Save the MBR */ diff --git a/storage/innobase/buf/buf0buf.cc b/storage/innobase/buf/buf0buf.cc index 5ef7a230b3c..7d898d967bc 100644 --- a/storage/innobase/buf/buf0buf.cc +++ b/storage/innobase/buf/buf0buf.cc @@ -551,16 +551,13 @@ decompress: decompress_with_slot: ut_d(fil_page_type_validate(space, dst_frame)); - bpage->write_size = fil_page_decompress( + ulint write_size = fil_page_decompress( slot->crypt_buf, dst_frame, space->flags); slot->release(); - ut_ad(!bpage->write_size - || fil_page_type_validate(space, dst_frame)); - + ut_ad(!write_size || fil_page_type_validate(space, dst_frame)); ut_ad(space->pending_io()); - - return bpage->write_size != 0; + return write_size != 0; } if (key_version && space->crypt_data) { @@ -1549,7 +1546,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; @@ -5263,7 +5259,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 947fce1ae3a..c092d78fa0d 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -4521,7 +4521,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); @@ -4556,7 +4556,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 295ddd14c5e..49c80cb4f5b 100644 --- a/storage/innobase/dict/dict0mem.cc +++ b/storage/innobase/dict/dict0mem.cc @@ -785,7 +785,6 @@ dict_mem_index_create( mutex_create(LATCH_ID_ZIP_PAD_MUTEX, &index->zip_pad.mutex); if (type & DICT_SPATIAL) { - mutex_create(LATCH_ID_RTR_SSN_MUTEX, &index->rtr_ssn.mutex); index->rtr_track = new (mem_heap_alloc(heap, sizeof *index->rtr_track)) rtr_info_track_t(); @@ -1098,7 +1097,7 @@ dict_mem_index_free( for (auto& rtr_info : index->rtr_track->rtr_active) { rtr_info->index = NULL; } - mutex_destroy(&index->rtr_ssn.mutex); + mutex_destroy(&index->rtr_track->rtr_active_mutex); index->rtr_track->~rtr_info_track_t(); } diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 4f11c50da9c..a3014fcd036 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -633,7 +633,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) }; @@ -2234,17 +2233,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 @@ -2264,22 +2252,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 @@ -19845,7 +19817,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 c0054287cd4..0a26d8e5671 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -529,13 +529,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 948dfae3c15..80f09ce9c31 100644 --- a/storage/innobase/ibuf/ibuf0ibuf.cc +++ b/storage/innobase/ibuf/ibuf0ibuf.cc @@ -2689,42 +2689,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 @@ -2817,11 +2803,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 93cf3742c88..19c18e4105d 100644 --- a/storage/innobase/include/buf0buf.h +++ b/storage/innobase/include/buf0buf.h @@ -1532,11 +1532,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 c202f29c004..9d73a48f4e6 100644 --- a/storage/innobase/include/dict0mem.h +++ b/storage/innobase/include/dict0mem.h @@ -1102,7 +1102,22 @@ struct dict_index_t { /* in which slot the next sample should be saved. */ /* @} */ - rtr_ssn_t rtr_ssn;/*!< Node sequence number for RTree */ +private: + /** R-tree split sequence number */ + std::atomic<node_seq_t> rtr_ssn; +public: + + void set_ssn(node_seq_t ssn) + { + rtr_ssn.store(ssn, std::memory_order_relaxed); + } + node_seq_t assign_ssn() + { + node_seq_t ssn= rtr_ssn.fetch_add(1, std::memory_order_relaxed); + return ssn + 1; + } + node_seq_t ssn() const { return rtr_ssn.load(std::memory_order_relaxed); } + 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.h b/storage/innobase/include/gis0rtree.h index e189b6a7f28..01fcc2943d2 100644 --- a/storage/innobase/include/gis0rtree.h +++ b/storage/innobase/include/gis0rtree.h @@ -191,23 +191,8 @@ rtr_non_leaf_insert_stack_push( double mbr_inc); /*!< in: MBR needs to be enlarged */ -/*****************************************************************//** -Allocates a new Split Sequence Number. -@return new SSN id */ -UNIV_INLINE -node_seq_t -rtr_get_new_ssn_id( -/*===============*/ - dict_index_t* index); /*!< in: the index struct */ - -/*****************************************************************//** -Get the current Split Sequence Number. -@return current SSN id */ -UNIV_INLINE -node_seq_t -rtr_get_current_ssn_id( -/*===================*/ - dict_index_t* index); /*!< in/out: the index struct */ +#define rtr_get_new_ssn_id(index) (index)->assign_ssn() +#define rtr_get_current_ssn_id(index) (index)->ssn() /********************************************************************//** Create a RTree search info structure */ diff --git a/storage/innobase/include/gis0rtree.ic b/storage/innobase/include/gis0rtree.ic index f01bc3fc9c9..2076b24b9b1 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 @@ -123,41 +123,6 @@ rtr_non_leaf_stack_push( #endif /* RTR_SEARCH_DIAGNOSTIC */ } -/*****************************************************************//** -Allocates a new Split Sequence Number. -@return new SSN id */ -UNIV_INLINE -node_seq_t -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); -} -/*****************************************************************//** -Get the current Split Sequence Number. -@return current SSN id */ -UNIV_INLINE -node_seq_t -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); -} - /*********************************************************************//** Sets pointer to the data and length in a field. */ UNIV_INLINE diff --git a/storage/innobase/include/gis0type.h b/storage/innobase/include/gis0type.h index 9d8dc841448..a1e0a878cb2 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, 2019, 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 @@ -142,12 +142,6 @@ struct rtr_info_track_t { rtr_active */ }; -/* 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 cd7f5355818..b0dab87c1db 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 fff861efe25..c0a3c86c737 100644 --- a/storage/innobase/include/page0page.ic +++ b/storage/innobase/include/page0page.ic @@ -165,9 +165,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 e2b5354d2de..4d2a7c8ff28 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 @@ -314,7 +314,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 852d74f603b..6b1acff489f 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1671,7 +1671,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 42d40d0fd7e..b54f96a3692 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -2430,11 +2430,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) { |