diff --git a/cmake/configure.pl b/cmake/configure.pl index 90ccf6e1e3db9..3139587a8e115 100644 --- a/cmake/configure.pl +++ b/cmake/configure.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. # diff --git a/cmake/dtrace.cmake b/cmake/dtrace.cmake index 4e0f75010453a..d3dded9949714 100644 --- a/cmake/dtrace.cmake +++ b/cmake/dtrace.cmake @@ -43,7 +43,8 @@ MACRO(CHECK_DTRACE) IF(DTRACE AND NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD" AND NOT BUGGY_GCC_NO_DTRACE_MODULES AND NOT BUGGY_LINUX_DTRACE - AND NOT CMAKE_SYSTEM_NAME MATCHES "SunOS") + AND NOT CMAKE_SYSTEM_NAME MATCHES "SunOS" + AND NOT WIN32) SET(ENABLE_DTRACE ON CACHE BOOL "Enable dtrace") ENDIF() # On GNU/Hurd, dtrace is not supported diff --git a/dbug/dbug.c b/dbug/dbug.c index e7bf69a14e567..831ea7fb43172 100644 --- a/dbug/dbug.c +++ b/dbug/dbug.c @@ -486,6 +486,7 @@ static int DbugParse(CODE_STATE *cs, const char *control) rel= control[0] == '+' || control[0] == '-'; if ((!rel || (!stack->out_file && !stack->next))) { + LockIfInitSettings(cs); FreeState(cs, 0); stack->flags= 0; stack->delay= 0; @@ -493,10 +494,9 @@ static int DbugParse(CODE_STATE *cs, const char *control) stack->sub_level= 0; stack->out_file= sstderr; stack->functions= NULL; - LockIfInitSettings(cs); stack->keywords= NULL; - UnlockIfInitSettings(cs); stack->processes= NULL; + UnlockIfInitSettings(cs); } else if (!stack->out_file) { diff --git a/dbug/dbug_add_tags.pl b/dbug/dbug_add_tags.pl index 7be8fb9b18da7..f117bdcd65b8d 100755 --- a/dbug/dbug_add_tags.pl +++ b/dbug/dbug_add_tags.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2002 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. diff --git a/dbug/remove_function_from_trace.pl b/dbug/remove_function_from_trace.pl index 380df168caf64..67d7fa54b6a08 100755 --- a/dbug/remove_function_from_trace.pl +++ b/dbug/remove_function_from_trace.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl die <((`test`.`t1`.`l1`,(select max(`test`.`t2`.`v1`) from `test`.`t2`) > convert((`test`.`t1`.`l1`) using utf8))) +SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); +l1 i2 +e 2 +o 6 +DROP TABLE t1, t2; +# # MDEV-22852: SIGSEGV in sortlength (optimized builds) # SET @save_optimizer_switch=@@optimizer_switch; @@ -2578,3 +2596,4 @@ SELECT (SELECT DISTINCT t1i.b FROM t1 t1i GROUP BY t1i.a ORDER BY MAX(t1o.b)) FR 0 SET @@optimizer_switch= @save_optimizer_switch; DROP TABLE t1; +# End of 10.2 tests diff --git a/mysql-test/std_data/checkDBI_DBD-mysql.pl b/mysql-test/std_data/checkDBI_DBD-mysql.pl index 328a7ad774f3a..0c26325b7157d 100755 --- a/mysql-test/std_data/checkDBI_DBD-mysql.pl +++ b/mysql-test/std_data/checkDBI_DBD-mysql.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2011, Oracle and/or its affiliates # diff --git a/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl b/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl index f277bce018ebe..e997f47946663 100755 --- a/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl +++ b/mysql-test/suite/engines/rr_trx/run_stress_tx_rr.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ################################################################################ # # This script runs the transactional stress test "stress_tx_rr" against the diff --git a/mysql-test/suite/funcs_1/lib/DataGen_local.pl b/mysql-test/suite/funcs_1/lib/DataGen_local.pl index 738a73e0fd575..8ca7440714120 100755 --- a/mysql-test/suite/funcs_1/lib/DataGen_local.pl +++ b/mysql-test/suite/funcs_1/lib/DataGen_local.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl if ( (scalar(@ARGV) != 1 ) || ($ARGV[0] =~ /[^0-9]/i ) ) diff --git a/mysql-test/suite/funcs_1/lib/DataGen_modify.pl b/mysql-test/suite/funcs_1/lib/DataGen_modify.pl index 4675049ff0db6..8ad8e619a2029 100755 --- a/mysql-test/suite/funcs_1/lib/DataGen_modify.pl +++ b/mysql-test/suite/funcs_1/lib/DataGen_modify.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl if ( (scalar(@ARGV) != 2 ) || ($ARGV[0] =~ /[^0-9]/i ) ) diff --git a/mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl b/mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl index 3b85ed02f5b2d..c0973a109507d 100755 --- a/mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl +++ b/mysql-test/suite/funcs_2/lib/gen_charset_utf8.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ################################################################################# # Author: Serge Kozlov # diff --git a/mysql-test/suite/galera/t/MW-86-wait1.test b/mysql-test/suite/galera/t/MW-86-wait1.test index a7476b74e6893..c5b78be64e5b8 100644 --- a/mysql-test/suite/galera/t/MW-86-wait1.test +++ b/mysql-test/suite/galera/t/MW-86-wait1.test @@ -7,6 +7,7 @@ --source include/have_binlog_format_row.inc --source include/have_debug.inc --source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc --connection node_2 # Make sure no signals have been leftover from previous tests to surprise us. diff --git a/mysql-test/suite/galera/t/MW-86-wait8.test b/mysql-test/suite/galera/t/MW-86-wait8.test index 551b0f67b7c51..a648924b9d8b9 100644 --- a/mysql-test/suite/galera/t/MW-86-wait8.test +++ b/mysql-test/suite/galera/t/MW-86-wait8.test @@ -3,7 +3,9 @@ # --source include/galera_cluster.inc --source include/have_binlog_format_row.inc +--source include/have_debug.inc --source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc --connection node_2 # Make sure no signals have been leftover from previous tests to surprise us. diff --git a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test index e13e7f1f748f1..6d1e21fd94d19 100644 --- a/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test +++ b/mysql-test/suite/galera/t/galera_query_cache_sync_wait.test @@ -1,6 +1,8 @@ --source include/galera_cluster.inc +--source include/have_debug.inc --source include/have_debug_sync.inc --source include/have_query_cache.inc +--source include/galera_have_debug_sync.inc CREATE TABLE t1 (id INT PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); diff --git a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test index 142f02546b485..d12ae7936cb38 100644 --- a/mysql-test/suite/galera/t/galera_var_retry_autocommit.test +++ b/mysql-test/suite/galera/t/galera_var_retry_autocommit.test @@ -4,7 +4,9 @@ --source include/galera_cluster.inc --source include/have_innodb.inc +--source include/have_debug.inc --source include/have_debug_sync.inc +--source include/galera_have_debug_sync.inc --connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 diff --git a/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync_section.result b/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync_section.result index a2bf5f4d98c17..bcf74142144a3 100644 --- a/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync_section.result +++ b/mysql-test/suite/galera_3nodes/r/galera_ipv6_rsync_section.result @@ -4,9 +4,12 @@ VARIABLE_VALUE LIKE '%[::1]%' SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; VARIABLE_VALUE = 3 1 +connection node_2; SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +connection node_1; CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB; INSERT INTO t1 VALUES (1); +connection node_2; SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; SELECT COUNT(*) = 1 FROM t1; COUNT(*) = 1 diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result new file mode 100644 index 0000000000000..0461f1f1feba3 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_A.result @@ -0,0 +1,40 @@ +CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 1); +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (2, 3); +SET wsrep_sync_wait = 0; +SET wsrep_on = OFF; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (3, 2); +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (4, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (5, 2); +SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request'; +SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (6, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (7, 2); +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (8, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration'; +SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +INSERT INTO t1 VALUES (9, 2); +SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; +SET GLOBAL wsrep_provider_options = 'dbug='; +DROP TABLE t1; +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result new file mode 100644 index 0000000000000..d878f60ca6bad --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_B.result @@ -0,0 +1,50 @@ +CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 1); +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (2, 3); +SET wsrep_sync_wait = 0; +SET wsrep_on = OFF; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (3, 2); +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (4, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (5, 2); +SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request'; +SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; +VARIABLE_NAME VARIABLE_VALUE +WSREP_DEBUG_SYNC_WAITERS after_shift_to_joining +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (6, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (7, 2); +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (8, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration'; +SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +INSERT INTO t1 VALUES (9, 2); +SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; +VARIABLE_NAME VARIABLE_VALUE +WSREP_DEBUG_SYNC_WAITERS process_primary_configuration +SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; +SET GLOBAL wsrep_provider_options = 'dbug='; +DROP TABLE t1; +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); diff --git a/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result new file mode 100644 index 0000000000000..df0a924029ce7 --- /dev/null +++ b/mysql-test/suite/galera_3nodes/r/galera_join_with_cc_C.result @@ -0,0 +1,55 @@ +CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 1); +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (2, 3); +SET wsrep_sync_wait = 0; +SET wsrep_on = OFF; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (3, 2); +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (4, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (5, 2); +SET GLOBAL wsrep_provider_options = 'dbug=d,before_send_state_request'; +SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +SET GLOBAL wsrep_provider_options = 'dbug=d,after_shift_to_joining'; +SET GLOBAL wsrep_provider_options = 'signal=before_send_state_request'; +4 +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; +VARIABLE_NAME VARIABLE_VALUE +WSREP_DEBUG_SYNC_WAITERS +INSERT INTO t1 VALUES (6, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +INSERT INTO t1 VALUES (7, 2); +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'dbug=d,process_primary_configuration'; +SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; +INSERT INTO t1 VALUES (8, 3); +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +INSERT INTO t1 VALUES (9, 2); +SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=process_primary_configuration'; +SET SESSION wsrep_on = 0; +SET SESSION wsrep_on = 0; +SET GLOBAL wsrep_provider_options = 'dbug='; +SET GLOBAL wsrep_provider_options = 'signal=after_shift_to_joining'; +DROP TABLE t1; +call mtr.add_suppression("WSREP: Send action {\(.*\), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)"); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); diff --git a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test new file mode 100644 index 0000000000000..e181b6831af9f --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_A.test @@ -0,0 +1,262 @@ +# +# Tests handling of several configuration changes while a joiner gets +# state transfer +# +# Variant A: sending of state transfer request delayed until two more +# primary configuration changes happen +# +# Refs codersihp/galera-bugs#454 +# +--source include/have_innodb.inc +--source include/galera_cluster.inc +--source suite/galera/include/galera_have_debug_sync.inc + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 1); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + +# +# Isolate node_1 and update cluster state to force node 1 into joiner mode +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (2, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; +--source include/wait_condition.inc + +# +# Now reconnect node_1 but first make it block before sending state transfer +# request +# +# THIS IS PC1 +# +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET wsrep_sync_wait = 0; +SET wsrep_on = OFF; +--let $galera_sync_point = after_shift_to_joining +--source include/galera_set_sync_point.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (3, 2); + +--connection node_1a +--source include/galera_wait_sync_point.inc +# +# At this point every node thinks that node_1 is in a JOINER state +# + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; +--source include/wait_condition.inc + +# +# Now that node_1 sent state request and became JOINER isolate node_1 again +# and commit one more action, so that node_1 loses JOINER state +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (4, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc + +# +# Reconnect node_1 again +# +# THIS IS PC2 +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# After this point node_1 is no longer JOINER and is required to start the +# whole procedure over because it missed some actions (4th insert into t1) +# + +INSERT INTO t1 VALUES (5, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; +--source include/wait_condition.inc + +# +# Now let node_1 continue with IST and finish processing PC1, but make it +# block when processing PC2 just before sending state transfer request +# +--connection node_1a +--let $galera_sync_point = before_send_state_request +--source include/galera_set_sync_point.inc +--let $galera_sync_point = after_shift_to_joining +--source include/galera_signal_sync_point.inc +--let $galera_sync_point = before_send_state_request +--source include/galera_wait_sync_point.inc + +# since PC1 has been processed node_1 must have 3 rows in t1 +# 2 were there before PC1 and one was added while in PC1 +--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; +--source include/wait_condition.inc + +# +# Now disconnect and reconnect node_1 again to get PC3 +# It still is blocked before sending state transfer request in PC2. +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (6, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 6 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# This is PC3 +# + +INSERT INTO t1 VALUES (7, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 7 FROM t1; +--source include/wait_condition.inc + +# +# Now disconnect and reconnect node_1 again to get PC4 and allow node_1 +# to send state transfer request to be delivered in PC4 (and thus get +# updated to PC4 seqno in state transfer. +# Note that node_1 still processes PC2. +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (8, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 8 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# This is PC4. node_1 is still processing PC2, waiting to send state trasfer +# request +# +--connection node_1a +--let $galera_sync_point = process_primary_configuration +--source include/galera_set_sync_point.inc +--let $galera_sync_point = before_send_state_request +--source include/galera_signal_sync_point.inc +# sent STR from PC2 into PC4 + +--let $galera_sync_point = process_primary_configuration +--source include/galera_wait_sync_point.inc +# +# Now node_1 is processing PC3, but should have completed state transfer from +# PC4 and thus must have 8 rows in t1 +# +--let $wait_condition = SELECT COUNT(*) = 8 FROM t1; +--source include/wait_condition.inc + +--connection node_2 +INSERT INTO t1 VALUES (9, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 9 FROM t1; +--source include/wait_condition.inc + +--connection node_1a +#--let $galera_sync_point = process_primary_configuration +--source include/galera_signal_sync_point.inc +--source include/galera_wait_sync_point.inc +# +# Now node_1 is processing PC4, still must have 8 rows in t1 +# +--let $wait_condition = SELECT COUNT(*) = 8 FROM t1; +--source include/wait_condition.inc + +#--let $galera_sync_point = process_primary_configuration +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +--let $wait_condition = SELECT COUNT(*) = 9 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc + +DROP TABLE t1; + +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); + +--connection node_2 +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); + +--connection node_3 +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); diff --git a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test new file mode 100644 index 0000000000000..7618f5a112c8d --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_B.test @@ -0,0 +1,273 @@ +# +# Tests handling of several configuration changes while a joiner gets +# state transfer +# +# Variant B: sending of state transfer request is immediate but completion +# of IST delayed until two more primary configuration changes happen +# +# Refs codersihp/galera-bugs#454 +# +--source include/have_innodb.inc +--source include/galera_cluster.inc +--source suite/galera/include/galera_have_debug_sync.inc + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 1); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + +# +# Isolate node_1 and update cluster state to force node 1 into joiner mode +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (2, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; +--source include/wait_condition.inc + +# +# Now reconnect node_1 but first make it block before sending state transfer +# request +# +# THIS IS PC1 +# +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET wsrep_sync_wait = 0; +SET wsrep_on = OFF; +--let $galera_sync_point = after_shift_to_joining +--source include/galera_set_sync_point.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (3, 2); + +--connection node_1a +--source include/galera_wait_sync_point.inc +# +# At this point every node thinks that node_1 is in a JOINER state +# + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; +--source include/wait_condition.inc + +# +# Now that node_1 sent state request and became JOINER isolate node_1 again +# and commit one more action, so that node_1 loses JOINER state +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (4, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc + +# +# Reconnect node_1 again +# +# THIS IS PC2 +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# After this point node_1 is no longer JOINER and is required to start the +# whole procedure over because it missed some actions (4th insert into t1) +# + +INSERT INTO t1 VALUES (5, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; +--source include/wait_condition.inc + +# +# Now let node_1 continue with IST and finish processing PC1, but make it +# block when processing PC2 right after progressing to JOINER state and +# before IST happens. +# +--connection node_1a +--let $galera_sync_point = before_send_state_request +--source include/galera_set_sync_point.inc +--let $galera_sync_point = after_shift_to_joining +--source include/galera_signal_sync_point.inc +--let $galera_sync_point = before_send_state_request +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc +# Here node_1 is processing PC2 just before sending state request + +# since PC1 has been processed node_1 must have 3 rows in t1 +# 2 were there before PC1 and one was added while in PC1 +--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; +--source include/wait_condition.inc + +# Proceed to sending state transfer request and block right after +--source include/galera_signal_sync_point.inc # before_send_state_request +--let $galera_sync_point = after_shift_to_joining +--source include/galera_wait_sync_point.inc +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; + +# +# Now disconnect and reconnect node_1 again to get PC3 +# It is blocked right after shifting to JOINING state. +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (6, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 6 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# This is PC3 +# + +INSERT INTO t1 VALUES (7, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 7 FROM t1; +--source include/wait_condition.inc + +# +# Now disconnect and reconnect node_1 again to get PC4 and allow node_1 +# to continue with IST. +# Note that node_1 still processes PC2 and is joining. +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (8, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 8 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# This is PC4. node_1 is still processing PC2, waiting to send state trasfer +# request +# +--connection node_1a +--let $galera_sync_point = process_primary_configuration +--source include/galera_set_sync_point.inc +--let $galera_sync_point = after_shift_to_joining +--source include/galera_signal_sync_point.inc +# continue with IST prepared for in PC2 + +--let $galera_sync_point = process_primary_configuration +--source include/galera_wait_sync_point.inc +# +# Now node_1 is processing PC3, and should have finished state transfer +# State tranfer request was dilivered before PC3, so node_1 should have +# received IST up to 4 rows in t1 (what was there before PC2) plus one more +# INSERT while in PC2. +# +--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; +--source include/wait_condition.inc + +--connection node_2 +INSERT INTO t1 VALUES (9, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 9 FROM t1; +--source include/wait_condition.inc + +--connection node_1a +#--let $galera_sync_point = process_primary_configuration +--source include/galera_signal_sync_point.inc +--source include/galera_wait_sync_point.inc +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; +# +# Now node_1 is processing PC4, still must have 8 rows in t1 +# +--let $wait_condition = SELECT COUNT(*) = 8 FROM t1; +--source include/wait_condition.inc + +#--let $galera_sync_point = process_primary_configuration +--source include/galera_signal_sync_point.inc +--source include/galera_clear_sync_point.inc + +--let $wait_condition = SELECT COUNT(*) = 9 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc + +DROP TABLE t1; + +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); + +--connection node_2 +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); + +--connection node_3 +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); diff --git a/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test new file mode 100644 index 0000000000000..68dea95854c0f --- /dev/null +++ b/mysql-test/suite/galera_3nodes/t/galera_join_with_cc_C.test @@ -0,0 +1,299 @@ +# +# Tests handling of several configuration changes while a joiner gets +# state transfer +# +# Variant C: sending of state transfer request is scheduled while in non-PRIM +# +# Refs codersihp/galera-bugs#454 +# +--source include/have_innodb.inc +--source include/galera_cluster.inc +--source suite/galera/include/galera_have_debug_sync.inc + +--let $galera_connection_name = node_3 +--let $galera_server_number = 3 +--source include/galera_connect.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +CREATE TABLE t1 (pk INT PRIMARY KEY, node INT) ENGINE=innodb; +INSERT INTO t1 VALUES (1, 1); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 1 FROM t1; +--source include/wait_condition.inc + +# +# Isolate node_1 and update cluster state to force node 1 into joiner mode +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (2, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 2 FROM t1; +--source include/wait_condition.inc + +# +# Now reconnect node_1 but first make it block before sending state transfer +# request +# +# THIS IS PC1 +# +--connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1 +SET wsrep_sync_wait = 0; +SET wsrep_on = OFF; +--let $galera_sync_point = after_shift_to_joining +--source include/galera_set_sync_point.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (3, 2); + +--connection node_1a +--source include/galera_wait_sync_point.inc +# +# At this point every node thinks that node_1 is in a JOINER state +# + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; +--source include/wait_condition.inc + +# +# Now that node_1 sent state request and became JOINER isolate node_1 again +# and commit one more action, so that node_1 loses JOINER state +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (4, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 4 FROM t1; +--source include/wait_condition.inc + +# +# Reconnect node_1 again +# +# THIS IS PC2 +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# After this point node_1 is no longer JOINER and is required to start the +# whole procedure over because it missed some actions (4th insert into t1) +# + +INSERT INTO t1 VALUES (5, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 5 FROM t1; +--source include/wait_condition.inc + +# +# Now let node_1 continue with IST and finish processing PC1, but make it +# block when processing PC2 right after progressing to JOINER state and +# before IST happens. +# +--connection node_1a +--let $galera_sync_point = before_send_state_request +--source include/galera_set_sync_point.inc +--let $galera_sync_point = after_shift_to_joining +--source include/galera_signal_sync_point.inc +--let $galera_sync_point = before_send_state_request +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc +# Here we are processing PC2 just before sending state request + +# since PC1 has been processed node_1 must have 3 rows in t1 +# 2 were there before PC1 and one was added while in PC1 +--let $wait_condition = SELECT COUNT(*) = 3 FROM t1; +--source include/wait_condition.inc + +# +# Now disconnect and reconnect node_1 again to get PC3 +# It still is blocked before sending state transfer request in PC2. +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +# Proceed to sending state transfer request +--connection node_1a +--let $galera_sync_point = after_shift_to_joining +--source include/galera_set_sync_point.inc +--let $galera_sync_point = before_send_state_request +--source include/galera_signal_sync_point.inc # before_send_state_request +# +# node_1 proceeds to sending state transfer request, it will be delivered only +# in the next PC which is PC3. Only then the node will shift to JOINING +# +--echo 4 +SELECT * FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_debug_sync_waiters'; + +--connection node_3 +INSERT INTO t1 VALUES (6, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 6 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# This is PC3 +# + +INSERT INTO t1 VALUES (7, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 7 FROM t1; +--source include/wait_condition.inc + +# node_1 is stiil processing PC2, it was let to send state transfer request +# while in non-PRIM. Now it should be able to complete it and shift to +# JOINING. Make it block on next PC(3) and continue to receive IST +--connection node_1a +--let $galera_sync_point = after_shift_to_joining +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc # won't need it any more +--let $galera_sync_point = process_primary_configuration +--source include/galera_set_sync_point.inc +--let $galera_sync_point = after_shift_to_joining +--source include/galera_signal_sync_point.inc +# continue with IST while still processing PC2 + +# +# Now disconnect and reconnect node_1 again to generate PC4. +# +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=1'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +--connection node_3 +--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc + +INSERT INTO t1 VALUES (8, 3); + +--connection node_2 +--let $wait_condition = SELECT COUNT(*) = 8 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +SET GLOBAL wsrep_provider_options='gmcast.isolate=0'; + +--connection node_2 +--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; +--source include/wait_condition.inc +# +# This is PC4. node_1 should complete IST, complete PC2, and continue +# with the next item in queue +# +--connection node_1a +--let $galera_sync_point = process_primary_configuration +--source include/galera_wait_sync_point.inc + +# +# Now node_1 is blocked before processing PC3, and should have finished state +# transfer started while in PC2. +# State tranfer request was dilivered in PC3 to donor, so node_1 should have +# received IST up to 6 rows in t1 (what was there before PC3). +# +--let $wait_condition = SELECT COUNT(*) = 6 FROM t1; +--source include/wait_condition.inc + +--connection node_2 +INSERT INTO t1 VALUES (9, 2); + +--connection node_3 +--let $wait_condition = SELECT COUNT(*) = 9 FROM t1; +--source include/wait_condition.inc + +--connection node_1a +# continue with processing PC3 +--let $galera_sync_point = process_primary_configuration +--source include/galera_signal_sync_point.inc + +# wait for row that follows PC3 +--let $wait_condition = SELECT COUNT(*) = 7 FROM t1; +--source include/wait_condition.inc + +# wait till PC4 +--let $galera_sync_point = process_primary_configuration +--source include/galera_wait_sync_point.inc +# +# Now node_1 is processing PC4, still must have 7 rows in t1 +# +--let $wait_condition = SELECT COUNT(*) = 7 FROM t1; +--source include/wait_condition.inc + +# Continue with PC4 +--let $galera_sync_point = process_primary_configuration +--source include/galera_clear_sync_point.inc +--source include/galera_signal_sync_point.inc +--let $galera_sync_point = after_shift_to_joining +--source include/galera_wait_sync_point.inc +--source include/galera_clear_sync_point.inc +--source include/galera_signal_sync_point.inc + +--let $wait_condition = SELECT COUNT(*) = 9 FROM t1; +--source include/wait_condition.inc + +--connection node_1 +--let $wait_condition = SELECT VARIABLE_VALUE = 'ON' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_ready'; +--source include/wait_condition.inc + +DROP TABLE t1; + +call mtr.add_suppression("WSREP: Send action {\(.*\), STATE_REQUEST} returned -107 \\(Transport endpoint is not connected\\)"); +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); + +--connection node_2 +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); + +--connection node_3 +call mtr.add_suppression("WSREP: Rejecting JOIN message from \(.*\): new State Transfer required."); diff --git a/mysql-test/suite/innodb/r/information_schema_grants.result b/mysql-test/suite/innodb/r/information_schema_grants.result index 6ef1ce170cd46..04550bfa114d9 100644 --- a/mysql-test/suite/innodb/r/information_schema_grants.result +++ b/mysql-test/suite/innodb/r/information_schema_grants.result @@ -278,9 +278,9 @@ select count(*) > -1 from d_sys_virtual; count(*) > -1 1 select count(*) > -1 from information_schema.innodb_tablespaces_encryption; -ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation select count(*) > -1 from i_tablespaces_encryption; -ERROR 42000: Access denied; you need (at least one of) the SUPER privilege(s) for this operation +ERROR 42000: Access denied; you need (at least one of) the PROCESS privilege(s) for this operation select count(*) > -1 from d_tablespaces_encryption; count(*) > -1 1 diff --git a/mysql-test/suite/rpl/extension/checksum.pl b/mysql-test/suite/rpl/extension/checksum.pl index f94341446cd33..8369d1bbdce7a 100755 --- a/mysql-test/suite/rpl/extension/checksum.pl +++ b/mysql-test/suite/rpl/extension/checksum.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. # diff --git a/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result b/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result new file mode 100644 index 0000000000000..b7f06a7dc46c2 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_binlog_dump_slave_gtid_state_info.result @@ -0,0 +1,47 @@ +include/master-slave.inc +[connection master] +connection master; +SET GLOBAL LOG_WARNINGS=2; +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=current_pos; +include/start_slave.inc +connection master; +"Test Case 1: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('')" +FOUND 1 /using_gtid\(1\), gtid\(\'\'\)/ in mysqld.1.err +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=no; +include/start_slave.inc +connection master; +"Test Case 2: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(0), gtid('')" +FOUND 1 /using_gtid\(0\), gtid\(\'\'\).*/ in mysqld.1.err +CREATE TABLE t (f INT) ENGINE=INNODB; +INSERT INTO t VALUES(10); +connection slave; +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=slave_pos; +include/start_slave.inc +connection master; +"Test Case 3: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('0-1-2')" +FOUND 1 /using_gtid\(1\), gtid\(\'0-1-2\'\)/ in mysqld.1.err +SET @@SESSION.gtid_domain_id=10; +INSERT INTO t VALUES(20); +connection slave; +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=slave_pos; +include/start_slave.inc +connection master; +"Test Case 4: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('0-1-2,10-1-1')" +FOUND 1 /using_gtid\(1\), gtid\(\'0-1-2,10-1-1\'\)/ in mysqld.1.err +"===== Clean up =====" +connection slave; +include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=no; +include/start_slave.inc +connection master; +DROP TABLE t; +SET GLOBAL LOG_WARNINGS=default; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_binlog_dump_slave_gtid_state_info.test b/mysql-test/suite/rpl/t/rpl_binlog_dump_slave_gtid_state_info.test new file mode 100644 index 0000000000000..63d4256bc7810 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_binlog_dump_slave_gtid_state_info.test @@ -0,0 +1,121 @@ +# ==== Purpose ==== +# +# Test verifies that Start binlog_dump message will report GTID position +# requested by slave when log_warnings > 1. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Have LOG_WARNINGS=2 +# 1 - On a fresh slave server which has not replicated any GTIDs execute +# "CHANGE MASTER TO MASTER_USE_GTID=current_pos;" command. Start the +# slave. +# 2 - In Master error log verify that pattern "using_gtid(1), gtid('')" is +# present. +# 3 - On slave server do STOP SLAVE and execute "CHANGE MASTER TO +# MASTER_USE_GTID=no;" command. Start the slave threads. +# 4 - In Master error log verify that pattern "using_gtid(0), gtid('')" is +# present. +# 5- Execute a DDL and DML on master server. This will generated two GTIDs +# on the master server ('0-1-2'). Sync the slave server with master. +# 6 - On slave do STOP SLAVE and execute "CHANGE MASTER TO +# MASTER_USE_GTID=slave_pos;" command. Start slave threads. +# 7 - In Master error verify that pattern "using_gtid(1), gtid('0-1-2')" is +# present. +# 8 - On Master change domain ID to 10 and execute a DML operation. It will +# generate a GTID 10-1-1. +# 9 - On slave do STOP SLAVE and execute "CHANGE MASTER TO +# MASTER_USE_GTID=slave_pos;" command. Start slave threads. +# 10 -In Master error verify that pattern "using_gtid(1), +# gtid('0-1-2,10-1-1')" is present. +# +# ==== References ==== +# +# MDEV-20428: "Start binlog_dump" message doesn't indicate GTID position +# + +--source include/have_binlog_format_mixed.inc +--source include/have_innodb.inc +--source include/master-slave.inc + +--connection master +SET GLOBAL LOG_WARNINGS=2; + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=current_pos; +--source include/start_slave.inc + +--connection master +# Check error log for correct messages. +let $log_error_= `SELECT @@GLOBAL.log_error`; +if(!$log_error_) +{ + # MySQL Server on windows is started with --console and thus + # does not know the location of its .err log, use default location + let $log_error_ = $MYSQLTEST_VARDIR/log/mysqld.1.err; +} +--echo "Test Case 1: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('')" +--let SEARCH_FILE=$log_error_ +--let SEARCH_RANGE=-50000 +--let SEARCH_PATTERN=using_gtid\(1\), gtid\(\'\'\) +--source include/search_pattern_in_file.inc + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=no; +--source include/start_slave.inc + +--connection master +--echo "Test Case 2: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(0), gtid('')" +--let SEARCH_FILE=$log_error_ +--let SEARCH_RANGE=-50000 +--let SEARCH_PATTERN=using_gtid\(0\), gtid\(\'\'\).* +--source include/search_pattern_in_file.inc +CREATE TABLE t (f INT) ENGINE=INNODB; +INSERT INTO t VALUES(10); +save_master_pos; + +--connection slave +sync_with_master; + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=slave_pos; +--source include/start_slave.inc + +--connection master +--echo "Test Case 3: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('0-1-2')" +--let SEARCH_FILE=$log_error_ +--let SEARCH_RANGE=-50000 +--let SEARCH_PATTERN=using_gtid\(1\), gtid\(\'0-1-2\'\) +--source include/search_pattern_in_file.inc +SET @@SESSION.gtid_domain_id=10; +INSERT INTO t VALUES(20); +save_master_pos; + +--connection slave +sync_with_master; + +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=slave_pos; +--source include/start_slave.inc + +--connection master +--echo "Test Case 4: Start binlog_dump to slave_server(#), pos(master-bin.000001, ###), using_gtid(1), gtid('0-1-2,10-1-1')" +--let SEARCH_FILE=$log_error_ +--let SEARCH_RANGE=-50000 +--let SEARCH_PATTERN=using_gtid\(1\), gtid\(\'0-1-2,10-1-1\'\) +--source include/search_pattern_in_file.inc + +--echo "===== Clean up =====" +--connection slave +--source include/stop_slave.inc +CHANGE MASTER TO MASTER_USE_GTID=no; +--source include/start_slave.inc + +--connection master +DROP TABLE t; +SET GLOBAL LOG_WARNINGS=default; +--source include/rpl_end.inc diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test index 20654a95717ab..2df105d46533a 100644 --- a/mysql-test/t/information_schema.test +++ b/mysql-test/t/information_schema.test @@ -1894,3 +1894,15 @@ SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (t SELECT count(*) FROM information_schema.columns WHERE table_schema='test' AND (table_name='tt1' AND column_name='c1') OR (table_name='tt2' AND column_name='c2'); SELECT column_name FROM information_schema.columns WHERE (table_name, column_name) IN (('tt1','c1'),('tt2', 'c2')) ORDER BY column_name; DROP TABLE tt1, tt2; + +--echo # +--echo # MDEV-13242 Wrong results for queries with row constructors and information_schema +--echo # + +SELECT SCHEMA_NAME from information_schema.schemata where schema_name='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'; +SELECT SCHEMA_NAME from information_schema.schemata where schema_name=REPEAT('a',193); + + +--echo # +--echo # End of 10.1 tests +--echo # diff --git a/mysql-test/t/nested_profiling.test b/mysql-test/t/nested_profiling.test new file mode 100644 index 0000000000000..ba89aefc647f6 --- /dev/null +++ b/mysql-test/t/nested_profiling.test @@ -0,0 +1,42 @@ +# ==== Purpose ==== +# +# Test verifies that "init_connect" and "init_slave" system variables work +# fine when "profiling=on". +# +# ==== Implementation ==== +# +# Steps: +# 0 - Create regular user without super privilege so that "init_connect" +# variable is effective. +# 1 - Enable profiling. +# 2 - Start a new connection which will try to execute the statements +# specified in "init_connect". No assert should be reported. +# 3 - Execute SHOW PROFILES to verify that statements specified in +# "init_connect" are displayed as part of profiling. +# +# ==== References ==== +# +# MDEV-22706: Assertion `!current' failed in PROFILING::start_new_query +# +--source include/not_embedded.inc +--source include/have_profiling.inc + +SET @saved_profiling=@@GLOBAL.profiling; +SET @saved_init_connect=@@GLOBAL.init_connect; +SET GLOBAL init_connect="set @a=2;set @b=3"; +SET GLOBAL profiling=on; + +create user mysqltest1@localhost; +connect (con1,localhost,mysqltest1,,); +connection con1; +SELECT @a, @b; +--replace_column 2 # +SHOW PROFILES; + +#========== Clean up =========== +connection default; +disconnect con1; +DROP USER mysqltest1@localhost; + +SET GLOBAL profiling=@saved_profiling; +SET GLOBAL init_connect=@saved_init_connect; diff --git a/mysql-test/t/subselect4.test b/mysql-test/t/subselect4.test index 057a450268499..95feb3cdb95ce 100644 --- a/mysql-test/t/subselect4.test +++ b/mysql-test/t/subselect4.test @@ -2102,6 +2102,19 @@ eval EXPLAIN EXTENDED $query; eval $query; DROP TABLE t1,t2; +--echo # +--echo # MDEV-17606: Query returns wrong results (while using CHARACTER SET utf8) +--echo # + +CREATE TABLE t1(l1 varchar(10), i2 int); +INSERT INTO t1 VALUES ('e',2),('o',6),('x',4); +CREATE TABLE t2 (v1 varchar(10) CHARACTER SET utf8, KEY v1 (v1(3))); +INSERT INTO t2 VALUES ('k'),('rid'),('f'),('x'); + +EXPLAIN EXTENDED SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); +SELECT * FROM t1 where ( t1.l1 < ANY (SELECT MAX(t2.v1) FROM t2)); +DROP TABLE t1, t2; + --echo # --echo # MDEV-22852: SIGSEGV in sortlength (optimized builds) --echo # @@ -2113,3 +2126,5 @@ INSERT INTO t1 VALUES (0,0),(0,0); SELECT (SELECT DISTINCT t1i.b FROM t1 t1i GROUP BY t1i.a ORDER BY MAX(t1o.b)) FROM t1 AS t1o; SET @@optimizer_switch= @save_optimizer_switch; DROP TABLE t1; + +--echo # End of 10.2 tests diff --git a/plugin/auth_gssapi/CMakeLists.txt b/plugin/auth_gssapi/CMakeLists.txt index d2f854c2918e3..bca4f5af3a15d 100644 --- a/plugin/auth_gssapi/CMakeLists.txt +++ b/plugin/auth_gssapi/CMakeLists.txt @@ -21,9 +21,9 @@ ELSE() SET(CMAKE_REQUIRED_INCLUDES ${GSSAPI_INCS}) SET(CMAKE_REQUIRED_LIBRARIES ${GSSAPI_LIBS}) INCLUDE(CheckCXXSymbolExists) - CHECK_CXX_SYMBOL_EXISTS(krb5_free_unparsed_name "krb5.h" HAVE_KRB5_FREE_UNPARSED_NAME) - IF(HAVE_KRB5_FREE_UNPARSED_NAME) - ADD_DEFINITIONS(-DHAVE_KRB5_FREE_UNPARSED_NAME=1) + CHECK_CXX_SYMBOL_EXISTS(krb5_xfree "krb5.h" HAVE_KRB5_XFREE) + IF(HAVE_KRB5_XFREE) + ADD_DEFINITIONS(-DHAVE_KRB5_XFREE=1) ENDIF() ELSE() diff --git a/plugin/auth_gssapi/gssapi_server.cc b/plugin/auth_gssapi/gssapi_server.cc index 9197b3e06fccc..2af87e820cfe2 100644 --- a/plugin/auth_gssapi/gssapi_server.cc +++ b/plugin/auth_gssapi/gssapi_server.cc @@ -31,7 +31,7 @@ static void log_error( OM_uint32 major, OM_uint32 minor, const char *msg) Generate default principal service name formatted as principal name "mariadb/server.fqdn@REALM" */ #include -#ifndef HAVE_KRB5_FREE_UNPARSED_NAME +#ifdef HAVE_KRB5_XFREE #define krb5_free_unparsed_name(a,b) krb5_xfree(b) #endif static char* get_default_principal_name() diff --git a/plugin/handler_socket/client/hspool_test.pl b/plugin/handler_socket/client/hspool_test.pl index 7fe073301b18d..973913d4ee99b 100755 --- a/plugin/handler_socket/client/hspool_test.pl +++ b/plugin/handler_socket/client/hspool_test.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl use strict; use warnings; diff --git a/plugin/handler_socket/client/hstest.pl b/plugin/handler_socket/client/hstest.pl index 4d177b6cdc87b..7651dddbc63f3 100755 --- a/plugin/handler_socket/client/hstest.pl +++ b/plugin/handler_socket/client/hstest.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=8:ai:ts=8 diff --git a/plugin/handler_socket/perl-Net-HandlerSocket/lib/Net/HandlerSocket/Pool.pm b/plugin/handler_socket/perl-Net-HandlerSocket/lib/Net/HandlerSocket/Pool.pm index c51fe60d5915e..b6ea62651a3d1 100755 --- a/plugin/handler_socket/perl-Net-HandlerSocket/lib/Net/HandlerSocket/Pool.pm +++ b/plugin/handler_socket/perl-Net-HandlerSocket/lib/Net/HandlerSocket/Pool.pm @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl package Net::HandlerSocket::HSPool; diff --git a/plugin/handler_socket/regtest/test_01_lib/test01.pl b/plugin/handler_socket/regtest/test_01_lib/test01.pl index d3a072fb3cc34..0a3ad9e9b259b 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test01.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test01.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test02.pl b/plugin/handler_socket/regtest/test_01_lib/test02.pl index c69515d76e90e..f9bdc8b67388c 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test02.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test02.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test03.pl b/plugin/handler_socket/regtest/test_01_lib/test03.pl index a081786c13225..a51aaf3b2579c 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test03.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test03.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test04.pl b/plugin/handler_socket/regtest/test_01_lib/test04.pl index 52fe11364c881..d922b71327136 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test04.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test04.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test05.pl b/plugin/handler_socket/regtest/test_01_lib/test05.pl index 10b1a0805a0e5..2993e7a9680c0 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test05.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test05.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test06.pl b/plugin/handler_socket/regtest/test_01_lib/test06.pl index fb0549f2295ad..69dd107e1ff99 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test06.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test06.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test07.pl b/plugin/handler_socket/regtest/test_01_lib/test07.pl index fa9802366d899..2286aeba9fef1 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test07.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test07.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test08.pl b/plugin/handler_socket/regtest/test_01_lib/test08.pl index c33bf190d2960..da736ef34c3d9 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test08.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test08.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test09.pl b/plugin/handler_socket/regtest/test_01_lib/test09.pl index 14fd9c26641b6..7d6165ece1e07 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test09.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test09.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test10.pl b/plugin/handler_socket/regtest/test_01_lib/test10.pl index fd294fe8b7874..560976ba9b290 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test10.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test10.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test11.pl b/plugin/handler_socket/regtest/test_01_lib/test11.pl index 5cfe3e8361496..cfaa940572c72 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test11.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test11.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test12.pl b/plugin/handler_socket/regtest/test_01_lib/test12.pl index 100a779de4eae..0cae379837257 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test12.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test12.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test13.pl b/plugin/handler_socket/regtest/test_01_lib/test13.pl index 1e1104d2a07ae..2068c4bc9b6c0 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test13.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test13.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test14.pl b/plugin/handler_socket/regtest/test_01_lib/test14.pl index ff4e433ae8f80..ab89073370b42 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test14.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test14.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test15.pl b/plugin/handler_socket/regtest/test_01_lib/test15.pl index 4c56d355708fc..2205be5b36302 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test15.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test15.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test16.pl b/plugin/handler_socket/regtest/test_01_lib/test16.pl index 6db8c576d7a85..c0c3fc556ff6e 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test16.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test16.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test17.pl b/plugin/handler_socket/regtest/test_01_lib/test17.pl index 1ffd7fa12421f..7c150dab7460e 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test17.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test17.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test18.pl b/plugin/handler_socket/regtest/test_01_lib/test18.pl index 87047bc9cba14..7854642af15ea 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test18.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test18.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test19.pl b/plugin/handler_socket/regtest/test_01_lib/test19.pl index 9870199c1a711..2e5363c8137e4 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test19.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test19.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test20.pl b/plugin/handler_socket/regtest/test_01_lib/test20.pl index 139bbf9aba176..96307e0a5f00d 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test20.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test20.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test21.pl b/plugin/handler_socket/regtest/test_01_lib/test21.pl index 413ea636400d7..34e9d43972b20 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test21.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test21.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test22.pl b/plugin/handler_socket/regtest/test_01_lib/test22.pl index cf029944292ed..370d16d60272a 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test22.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test22.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test23.pl b/plugin/handler_socket/regtest/test_01_lib/test23.pl index 83c2194bfa685..d9bd0381251df 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test23.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test23.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/plugin/handler_socket/regtest/test_01_lib/test24.pl b/plugin/handler_socket/regtest/test_01_lib/test24.pl index 6cd95a995e550..f4e3bb3f10ce6 100644 --- a/plugin/handler_socket/regtest/test_01_lib/test24.pl +++ b/plugin/handler_socket/regtest/test_01_lib/test24.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # vim:sw=2:ai diff --git a/scripts/convert-debug-for-diff.sh b/scripts/convert-debug-for-diff.sh index 5b3ce05b8159f..60b328d946b22 100755 --- a/scripts/convert-debug-for-diff.sh +++ b/scripts/convert-debug-for-diff.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl -i +#!/usr/bin/env perl -i # # This script converts all numbers that look like addresses or memory sizes, # in a debug files generated by --debug (like mysqld --debug-dbug), to #. diff --git a/scripts/mytop.sh b/scripts/mytop.sh index 3ef0a59f27f76..e985d518c0129 100644 --- a/scripts/mytop.sh +++ b/scripts/mytop.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # # $Id: mytop,v 1.91 2012/01/18 16:49:12 mgrennan Exp $ diff --git a/sql-bench/as3ap.sh b/sql-bench/as3ap.sh index fd2b6ba3b255e..8e4b316742962 100644 --- a/sql-bench/as3ap.sh +++ b/sql-bench/as3ap.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/bench-count-distinct.sh b/sql-bench/bench-count-distinct.sh index 9ce9b2fb16804..b6465d0635fbc 100644 --- a/sql-bench/bench-count-distinct.sh +++ b/sql-bench/bench-count-distinct.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/bench-init.pl.sh b/sql-bench/bench-init.pl.sh index 1b6509cebcc1c..eeff8665cba3f 100644 --- a/sql-bench/bench-init.pl.sh +++ b/sql-bench/bench-init.pl.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000-2003, 2005-2007 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/compare-results.sh b/sql-bench/compare-results.sh index f0658160db22b..06e247bae8a57 100644 --- a/sql-bench/compare-results.sh +++ b/sql-bench/compare-results.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/copy-db.sh b/sql-bench/copy-db.sh index 38a010e52ab5d..d70472feaff49 100644 --- a/sql-bench/copy-db.sh +++ b/sql-bench/copy-db.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh index a7298c5f9a156..26f66f947359a 100644 --- a/sql-bench/crash-me.sh +++ b/sql-bench/crash-me.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # -*- perl -*- # Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. diff --git a/sql-bench/graph-compare-results.sh b/sql-bench/graph-compare-results.sh index ddc9080acd64e..d43f722cb147c 100755 --- a/sql-bench/graph-compare-results.sh +++ b/sql-bench/graph-compare-results.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl #### #### Hello ... this is a heavily hacked script by Luuk #### instead of printing the result it makes a nice gif diff --git a/sql-bench/innotest1.sh b/sql-bench/innotest1.sh index 9e1ed32c27349..1b99f601f429d 100644 --- a/sql-bench/innotest1.sh +++ b/sql-bench/innotest1.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ############################################################################ # Stress test for MySQL/InnoDB combined database # (c) 2002 Innobase Oy & MySQL AB diff --git a/sql-bench/innotest1a.sh b/sql-bench/innotest1a.sh index 1e428e33dcffd..7183c90183197 100644 --- a/sql-bench/innotest1a.sh +++ b/sql-bench/innotest1a.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ############################################################################ # Stress test for MySQL/InnoDB combined database # (c) 2002 Innobase Oy & MySQL AB diff --git a/sql-bench/innotest1b.sh b/sql-bench/innotest1b.sh index 524a6e0e145ec..0a909d1a8f6c8 100644 --- a/sql-bench/innotest1b.sh +++ b/sql-bench/innotest1b.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ############################################################################ # Stress test for MySQL/InnoDB combined database # (c) 2002 Innobase Oy & MySQL AB diff --git a/sql-bench/innotest2.sh b/sql-bench/innotest2.sh index fa0fd4189684f..941b0ac8b5998 100644 --- a/sql-bench/innotest2.sh +++ b/sql-bench/innotest2.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ############################################################################ # Stress test for MySQL/InnoDB combined database # (c) 2002 Innobase Oy & MySQL AB diff --git a/sql-bench/innotest2a.sh b/sql-bench/innotest2a.sh index 4a6e4b20a9a35..e873d2b458c4b 100644 --- a/sql-bench/innotest2a.sh +++ b/sql-bench/innotest2a.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ############################################################################ # Stress test for MySQL/Innobase combined database # (c) 2000 Innobase Oy & MySQL AB diff --git a/sql-bench/innotest2b.sh b/sql-bench/innotest2b.sh index b94325ff39e58..56b44eda56171 100644 --- a/sql-bench/innotest2b.sh +++ b/sql-bench/innotest2b.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl ############################################################################ # Stress test for MySQL/Innobase combined database # (c) 2000 Innobase Oy & MySQL AB diff --git a/sql-bench/run-all-tests.sh b/sql-bench/run-all-tests.sh index 5d77c8c388d5d..ecab48e88fe02 100644 --- a/sql-bench/run-all-tests.sh +++ b/sql-bench/run-all-tests.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh index fcdfe0b678faf..6cc58f527afb7 100644 --- a/sql-bench/server-cfg.sh +++ b/sql-bench/server-cfg.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # -*- perl -*- # Copyright (c) 2000-2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. diff --git a/sql-bench/test-ATIS.sh b/sql-bench/test-ATIS.sh index d3c242db256d8..2e082012a8feb 100644 --- a/sql-bench/test-ATIS.sh +++ b/sql-bench/test-ATIS.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-alter-table.sh b/sql-bench/test-alter-table.sh index 3a7f325b604c4..0602bd1f7fc9b 100644 --- a/sql-bench/test-alter-table.sh +++ b/sql-bench/test-alter-table.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-big-tables.sh b/sql-bench/test-big-tables.sh index e2cf983de1c3d..6be907d0ee651 100644 --- a/sql-bench/test-big-tables.sh +++ b/sql-bench/test-big-tables.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-connect.sh b/sql-bench/test-connect.sh index 1226301df9bbb..e3acb453a3031 100644 --- a/sql-bench/test-connect.sh +++ b/sql-bench/test-connect.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-create.sh b/sql-bench/test-create.sh index 7af6fa1356213..09961f0d698b6 100644 --- a/sql-bench/test-create.sh +++ b/sql-bench/test-create.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000-2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-insert.sh b/sql-bench/test-insert.sh index be57b04471a05..0cb951d86c8fb 100644 --- a/sql-bench/test-insert.sh +++ b/sql-bench/test-insert.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000-2003, 2006, 2007 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-select.sh b/sql-bench/test-select.sh index 4c7147b57a437..e3020698cb8c5 100644 --- a/sql-bench/test-select.sh +++ b/sql-bench/test-select.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-table-elimination.sh b/sql-bench/test-table-elimination.sh index de440fc0633d6..c3a264492a4b3 100755 --- a/sql-bench/test-table-elimination.sh +++ b/sql-bench/test-table-elimination.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Test of table elimination feature use Cwd; diff --git a/sql-bench/test-transactions.sh b/sql-bench/test-transactions.sh index 4732658c529dd..334a6f0a3850a 100644 --- a/sql-bench/test-transactions.sh +++ b/sql-bench/test-transactions.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql-bench/test-wisconsin.sh b/sql-bench/test-wisconsin.sh index 47c9e0503048c..581db89712eb1 100644 --- a/sql-bench/test-wisconsin.sh +++ b/sql-bench/test-wisconsin.sh @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2001, 2003, 2006 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. # diff --git a/sql/item_subselect.cc b/sql/item_subselect.cc index 640ed3116026f..92a86063d04d8 100644 --- a/sql/item_subselect.cc +++ b/sql/item_subselect.cc @@ -2038,7 +2038,7 @@ bool Item_allany_subselect::transform_into_max_min(JOIN *join) The swap is needed for expressions of type 'f1 < ALL ( SELECT ....)' where we want to evaluate the sub query even if f1 would be null. */ - subs= func->create_swap(thd, *(optimizer->get_cache()), subs); + subs= func->create_swap(thd, expr, subs); thd->change_item_tree(place, subs); if (subs->fix_fields(thd, &subs)) DBUG_RETURN(true); diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index 7215cdd4b9697..99f8da2c928c1 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -1,5 +1,5 @@ /* Copyright (c) 2006, 2017, Oracle and/or its affiliates. - Copyright (c) 2010, 2017, MariaDB Corporation + Copyright (c) 2010, 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 @@ -1467,8 +1467,14 @@ bool Relay_log_info::stmt_done(my_off_t event_master_log_pos, THD *thd, } DBUG_EXECUTE_IF("inject_crash_before_flush_rli", DBUG_SUICIDE();); if (mi->using_gtid == Master_info::USE_GTID_NO) + { + if (rgi->is_parallel_exec) + mysql_mutex_lock(&data_lock); if (flush()) error= 1; + if (rgi->is_parallel_exec) + mysql_mutex_unlock(&data_lock); + } DBUG_EXECUTE_IF("inject_crash_after_flush_rli", DBUG_SUICIDE();); } DBUG_RETURN(error); diff --git a/sql/signal_handler.cc b/sql/signal_handler.cc index c20f9920b7e47..c913a0477d7f4 100644 --- a/sql/signal_handler.cc +++ b/sql/signal_handler.cc @@ -277,7 +277,7 @@ extern "C" sig_handler handle_fatal_signal(int sig) } my_safe_printf_stderr("%s", "The manual page at " - "http://dev.mysql.com/doc/mysql/en/crashing.html contains\n" + "https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains\n" "information that should help you find out what is causing the crash.\n"); #endif /* HAVE_STACKTRACE */ diff --git a/sql/sql_class.h b/sql/sql_class.h index 838998af94f60..1e4f0225397ed 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -3610,11 +3610,7 @@ class THD :public Statement, bool is_bulk_op() const { return MY_TEST(bulk_param); } /// Returns Diagnostics-area for the current statement. - Diagnostics_area *get_stmt_da() - { return m_stmt_da; } - - /// Returns Diagnostics-area for the current statement. - const Diagnostics_area *get_stmt_da() const + Diagnostics_area *get_stmt_da() const { return m_stmt_da; } /// Sets Diagnostics-area for the current statement. diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index f1c9479adc7d0..66433d11d8fd2 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -913,11 +913,6 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, char *buf= thd->strmake(init_command->str, len); mysql_rwlock_unlock(var_lock); -#if defined(ENABLED_PROFILING) - thd->profiling.start_new_query(); - thd->profiling.set_query_source(buf, len); -#endif - THD_STAGE_INFO(thd, stage_execution_of_init_command); save_client_capabilities= thd->client_capabilities; thd->client_capabilities|= CLIENT_MULTI_QUERIES; @@ -932,9 +927,6 @@ void execute_init_command(THD *thd, LEX_STRING *init_command, thd->client_capabilities= save_client_capabilities; thd->net.vio= save_vio; -#if defined(ENABLED_PROFILING) - thd->profiling.finish_current_query(); -#endif } diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index a1ff4affd5030..721b6799ed3e5 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -2038,9 +2038,13 @@ static int init_binlog_sender(binlog_send_info *info, }); if (global_system_variables.log_warnings > 1) + { sql_print_information( - "Start binlog_dump to slave_server(%lu), pos(%s, %lu)", - thd->variables.server_id, log_ident, (ulong)*pos); + "Start binlog_dump to slave_server(%lu), pos(%s, %lu), " + "using_gtid(%d), gtid('%s')", thd->variables.server_id, + log_ident, (ulong)*pos, info->using_gtid_state, + connect_gtid_state.c_ptr_quick()); + } #ifndef DBUG_OFF if (opt_sporadic_binlog_dump_fail && (binlog_dump_count++ % 2)) diff --git a/sql/sql_show.cc b/sql/sql_show.cc index 4e37b53b87ebf..205b9facc7f9a 100644 --- a/sql/sql_show.cc +++ b/sql/sql_show.cc @@ -5079,6 +5079,29 @@ bool store_schema_shemata(THD* thd, TABLE *table, LEX_STRING *db_name, } +/* + Check if the specified database exists on disk. + + @param dbname - the database name + @retval true - on error, the database directory does not exists + @retval false - on success, the database directory exists +*/ +static bool verify_database_directory_exists(const LEX_STRING &dbname) +{ + DBUG_ENTER("verity_database_exists"); + char path[FN_REFLEN + 16]; + uint path_len; + MY_STAT stat_info; + if (!dbname.str[0]) + DBUG_RETURN(true); // Empty database name: does not exits. + path_len= build_table_filename(path, sizeof(path) - 1, dbname.str, "", "", 0); + path[path_len - 1]= 0; + if (!mysql_file_stat(key_file_misc, path, &stat_info, MYF(0))) + DBUG_RETURN(true); // The database directory was not found: does not exists. + DBUG_RETURN(false); // The database directory was found. +} + + int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) { /* @@ -5107,19 +5130,10 @@ int fill_schema_schemata(THD *thd, TABLE_LIST *tables, COND *cond) If we have lookup db value we should check that the database exists */ if(lookup_field_vals.db_value.str && !lookup_field_vals.wild_db_value && - db_names.at(0) != &INFORMATION_SCHEMA_NAME) - { - char path[FN_REFLEN+16]; - uint path_len; - MY_STAT stat_info; - if (!lookup_field_vals.db_value.str[0]) - DBUG_RETURN(0); - path_len= build_table_filename(path, sizeof(path) - 1, - lookup_field_vals.db_value.str, "", "", 0); - path[path_len-1]= 0; - if (!mysql_file_stat(key_file_misc, path, &stat_info, MYF(0))) - DBUG_RETURN(0); - } + (!db_names.elements() /* The database name was too long */|| + (db_names.at(0) != &INFORMATION_SCHEMA_NAME && + verify_database_directory_exists(lookup_field_vals.db_value)))) + DBUG_RETURN(0); for (size_t i=0; i < db_names.elements(); i++) { diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 584f6e05714e1..dd38abcb4032a 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -8619,7 +8619,7 @@ i_s_tablespaces_encryption_fill_table( RETURN_IF_INNODB_NOT_STARTED(tables->schema_table_name); /* deny access to user without PROCESS_ACL privilege */ - if (check_global_access(thd, SUPER_ACL)) { + if (check_global_access(thd, PROCESS_ACL)) { DBUG_RETURN(0); } diff --git a/storage/myisam/ftbench/Ecompare.pl b/storage/myisam/ftbench/Ecompare.pl index 07132ef900193..a97f126e64ea3 100755 --- a/storage/myisam/ftbench/Ecompare.pl +++ b/storage/myisam/ftbench/Ecompare.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2003, 2005 MySQL AB # Use is subject to license terms diff --git a/storage/myisam/ftbench/Ecreate.pl b/storage/myisam/ftbench/Ecreate.pl index 86af9f9c0a5bd..78962466c803e 100755 --- a/storage/myisam/ftbench/Ecreate.pl +++ b/storage/myisam/ftbench/Ecreate.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2003, 2005 MySQL AB # Use is subject to license terms diff --git a/storage/myisam/ftbench/Ereport.pl b/storage/myisam/ftbench/Ereport.pl index d3f8961ec8591..a8c7c57e1bea3 100755 --- a/storage/myisam/ftbench/Ereport.pl +++ b/storage/myisam/ftbench/Ereport.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2003, 2005 MySQL AB # Use is subject to license terms diff --git a/tests/big_record.pl b/tests/big_record.pl index cb1f89984682e..b08f7ea60e226 100755 --- a/tests/big_record.pl +++ b/tests/big_record.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. # diff --git a/tests/drop_test.pl b/tests/drop_test.pl index 329f65eb65da6..e4ae5a2671f5f 100755 --- a/tests/drop_test.pl +++ b/tests/drop_test.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2000 MySQL AB # Use is subject to license terms diff --git a/tests/export.pl b/tests/export.pl index f99798ecac80f..dace79feb300c 100755 --- a/tests/export.pl +++ b/tests/export.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) 2000, 2001 MySQL AB # Use is subject to license terms diff --git a/tests/fork2_test.pl b/tests/fork2_test.pl index 356055733fa16..a05a9b9667919 100755 --- a/tests/fork2_test.pl +++ b/tests/fork2_test.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2000, 2001 MySQL AB # Use is subject to license terms diff --git a/tests/fork_big.pl b/tests/fork_big.pl index 623377ab5cdd2..b5f8770c9032b 100755 --- a/tests/fork_big.pl +++ b/tests/fork_big.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w use strict; # Copyright (c) 2001, 2006 MySQL AB diff --git a/tests/fork_big2.pl b/tests/fork_big2.pl index c844d29083458..7f0556091084b 100644 --- a/tests/fork_big2.pl +++ b/tests/fork_big2.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (c) 2002, 2003, 2005, 2006 MySQL AB # Use is subject to license terms diff --git a/tests/grant.pl b/tests/grant.pl index cd6516433166e..b50481a93fc6e 100755 --- a/tests/grant.pl +++ b/tests/grant.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2000, 2005 MySQL AB, 2009 Sun Microsystems, Inc. # Use is subject to license terms. diff --git a/tests/index_corrupt.pl b/tests/index_corrupt.pl index 6b04ce8a59c59..8194982755aa0 100755 --- a/tests/index_corrupt.pl +++ b/tests/index_corrupt.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2005 MySQL AB # Use is subject to license terms diff --git a/tests/insert_and_repair.pl b/tests/insert_and_repair.pl index 18091c92718db..91333746e7926 100755 --- a/tests/insert_and_repair.pl +++ b/tests/insert_and_repair.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2000, 2001 MySQL AB # Use is subject to license terms diff --git a/tests/lock_test.pl b/tests/lock_test.pl index 98c4ad6377d5b..8a8a0322467b9 100755 --- a/tests/lock_test.pl +++ b/tests/lock_test.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) 2000 MySQL AB # Use is subject to license terms diff --git a/tests/mail_to_db.pl b/tests/mail_to_db.pl index e50415d96f314..6e5c115f5438e 100755 --- a/tests/mail_to_db.pl +++ b/tests/mail_to_db.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright Abandoned 1998 TCX DataKonsult AB & Monty Program KB & Detron HB # This file is public domain and comes with NO WARRANTY of any kind # diff --git a/tests/pmail.pl b/tests/pmail.pl index 359256c25b344..97e5914f7941b 100755 --- a/tests/pmail.pl +++ b/tests/pmail.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2000, 2005 MySQL AB # Use is subject to license terms diff --git a/tests/rename_test.pl b/tests/rename_test.pl index d7097df1e4e3b..ec7254a4cf6ae 100755 --- a/tests/rename_test.pl +++ b/tests/rename_test.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2000, 2001 MySQL AB # Use is subject to license terms diff --git a/tests/table_types.pl b/tests/table_types.pl index c633a1530989f..782b8f254bfae 100755 --- a/tests/table_types.pl +++ b/tests/table_types.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (C) 2000, 2003 MySQL AB # Use is subject to license terms diff --git a/tests/test_delayed_insert.pl b/tests/test_delayed_insert.pl index cb5b86a228d13..2f8f97b25c64f 100755 --- a/tests/test_delayed_insert.pl +++ b/tests/test_delayed_insert.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2000, 2001 MySQL AB # Use is subject to license terms diff --git a/tests/truncate.pl b/tests/truncate.pl index 98791a15b2c67..e83ebab92911b 100755 --- a/tests/truncate.pl +++ b/tests/truncate.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl -w # Copyright (C) 2002 MySQL AB # Use is subject to license terms diff --git a/unittest/unit.pl b/unittest/unit.pl index fb9a16fbe496e..dc72a57d20c3a 100644 --- a/unittest/unit.pl +++ b/unittest/unit.pl @@ -1,4 +1,4 @@ -#!/usr/bin/perl +#!/usr/bin/env perl # Copyright (c) 2006 MySQL AB, 2009, 2010 Sun Microsystems, Inc. # Use is subject to license terms. #