diff --git a/.gitmodules b/.gitmodules index 00ddc758edb0..dc657ac1b680 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,7 @@ [submodule "percona-xtradb-cluster-galera"] path = percona-xtradb-cluster-galera - url = https://github.com/kamil-holubicki/galera - branch = PXC-4435-galera + url = https://github.com/percona/galera + branch = 4.x-8.0 [submodule "wsrep-lib"] path = wsrep-lib url = https://github.com/percona/wsrep-lib.git diff --git a/mysql-test/collections/disabled.def b/mysql-test/collections/disabled.def index ce42ed102802..6a15a8f24456 100644 --- a/mysql-test/collections/disabled.def +++ b/mysql-test/collections/disabled.def @@ -83,9 +83,6 @@ innodb_undo.i_s_files_32k : BUG#3129 PXC requires 16k In # innodb_gis innodb_gis.gis_split_nan : BUG#3129 PXC requires 16k InnoDB page size (https://jira.percona.com/browse/PXC-3129) -# keyring tests -keyring_encrypted_file.keyring_migration_bugs @darwin : Bug#31041633 - # Tests that run ALTER on the "mysql" database innodb.mysql_ts_alter_encrypt_1 : BUG#29531106 - ATTACHABLE_TRX(): ASSERTION `!M_THD->TRANSACTION_ROLLBACK_REQUEST' FAILED component_keyring_file.mysql_ts_alter_encrypt_1 : BUG#29531106 - ATTACHABLE_TRX(): ASSERTION `!M_THD->TRANSACTION_ROLLBACK_REQUEST' FAILED @@ -94,7 +91,6 @@ component_keyring_file.mysql_ts_alter_encrypt_1 : BUG#29531106 - ATTACHABLE_TRX( # main suite tests main.initialize : BUG#3129 PXC requires 16k InnoDB page size (https://jira.percona.com/browse/PXC-3129) main.ds_mrr-big @solaris : BUG#14168107 Test leads to timeout on Solaris on slow sparc servers. -main.gtid_next_xa_binlog_off : BUG#33650776 Failure of XA COMMIT of prepared txn, can result in txn rollback main.print_stacktrace : Bug#36027494 Add mtr test for my_print_stacktrace # Disabled due to InnoDB issues diff --git a/mysql-test/include/mtr_check.sql b/mysql-test/include/mtr_check.sql index a7fcbc8fee9b..15f991b18a47 100644 --- a/mysql-test/include/mtr_check.sql +++ b/mysql-test/include/mtr_check.sql @@ -121,7 +121,6 @@ BEGIN 'auto_increment_offset', 'auto_increment_increment', 'wsrep_data_home_dir', - 'keyring_file_data', 'innodb_thread_sleep_delay') ORDER BY VARIABLE_NAME; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index 5c00d5cf3d0f..8cc9c911a5de 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -4492,6 +4492,7 @@ sub default_mysqld { user => $opt_user, password => '', worker => DEFAULT_WORKER_ID, + bind_local => $opt_bind_local }); my $mysqld = $config->group('mysqld.1') or @@ -5353,7 +5354,8 @@ ($) user => $opt_user, vardir => $opt_vardir, worker => $tinfo->{worker} || - DEFAULT_WORKER_ID + DEFAULT_WORKER_ID, + bind_local => $opt_bind_local }); # Write the new my.cnf diff --git a/mysql-test/suite/galera-x/t/prep_stmt_sundries.test b/mysql-test/suite/galera-x/t/prep_stmt_sundries.test index e9df808a7a58..855586b03b00 100644 --- a/mysql-test/suite/galera-x/t/prep_stmt_sundries.test +++ b/mysql-test/suite/galera-x/t/prep_stmt_sundries.test @@ -480,7 +480,7 @@ source ../include/wait_for_status_variables.inc; --let $assert_cond= [SHOW GLOBAL STATUS LIKE "Prepared_stmt_count", Value, 1] = 0 --source include/assert.inc -# When Percona Telemetry is built-in it installs the component, which changes conters values +# When Percona Telemetry is built-in it installs the component, which changes counters values --let $Com_stmt_prepare_expected = 11 --let $Com_stmt_execute_expected = 6 --let $Com_stmt_close_expected = 7 diff --git a/mysql-test/suite/perfschema/r/dd_version_check.result b/mysql-test/suite/perfschema/r/dd_version_check.result index 57c64a638910..a13df2bccb3a 100644 --- a/mysql-test/suite/perfschema/r/dd_version_check.result +++ b/mysql-test/suite/perfschema/r/dd_version_check.result @@ -1,6 +1,8 @@ "Checking the data dictionary properties ..." -SUBSTRING_INDEX(SUBSTRING(properties, LOCATE('PS_VERSION', properties), 30), ';', 1) +DATA DICTIONARY TAG PS_VERSION=80300 +DATA DICTIONARY VERSION +80300 "Checking the performance schema database structure ..." CHECK STATUS -The tables in the performance_schema were last changed in MySQL 8.3.0 +The tables in the performance_schema were last changed in MySQL 8.3.0, with a PFS_DD_VERSION = 80300 diff --git a/mysql-test/suite/perfschema/t/dd_version_check.test b/mysql-test/suite/perfschema/t/dd_version_check.test index e1c8ecad7a12..a85cc7277aca 100644 --- a/mysql-test/suite/perfschema/t/dd_version_check.test +++ b/mysql-test/suite/perfschema/t/dd_version_check.test @@ -13,16 +13,26 @@ drop procedure if exists test.pfs_check_proc; SET SESSION debug= '+d,skip_dd_table_access_check'; SELECT SUBSTRING_INDEX(SUBSTRING(properties, LOCATE('PS_VERSION', properties), 30), ';', 1) + into @actual_dd_version_tag FROM mysql.dd_properties; SET SESSION debug= '-d,skip_dd_table_access_check'; +SELECT @actual_dd_version_tag as "DATA DICTIONARY TAG"; + +SELECT SUBSTRING(@actual_dd_version_tag, 12) into @actual_dd_version; +SELECT @actual_dd_version as "DATA DICTIONARY VERSION"; + SET @old_group_concat_max_len = @@group_concat_max_len; # We need 1700 rows of varchar(64) concatenated SET group_concat_max_len = 200000; create table test.pfs_published_schema - (version varchar(20), signature varchar(64), primary key (version)); + (version varchar(20) not null, + pfs_dd_version integer not null, + signature varchar(64) not null, + primary key (version), + unique key(pfs_dd_version)); # # MAINTAINER: @@ -35,11 +45,12 @@ create table test.pfs_published_schema # database structure is detected, acting as a fail safe. # # If a change was intended, then: -# - (a) Go in storage/perfschema/pfs_dd_version.h +# - (a) Go in storage/perfschema/pfs_dd_version.h, +# find the declaration of variable PFS_DD_VERSION, # and create a new version number for this release # - (b) Add a row in table test.pfs_published_schema -# for the new schema published, using the signature -# of the new schema. +# for the new schema published, using the new PFS_DD_VERSION +# and the signature of the new schema. # # (a) will ensure that upgrades from old releases # will notice the schema change, and upgrade @@ -62,79 +73,89 @@ create table test.pfs_published_schema # Keeping track of all signatures published in GA ... insert into test.pfs_published_schema - values("MySQL 8.0.17", + values("MySQL 8.0.17", 80017, "b77ece4deaa3c4676d817ed98c3cc33f5b1a08a001bf610a7d02fb52a42b613d"); insert into test.pfs_published_schema - values("MySQL 8.0.172", + values("MySQL 8.0.172", 800172, "4b2535cee3a558d09b93caaa1fe9021da9e758ffcacd0922bea81ae9799175dc"); insert into test.pfs_published_schema - values("MySQL 8.0.18", + values("MySQL 8.0.18", 80018, "1d6747d842bb2483c860cd7b28e886bdc6111ff61fd6b4d07e367aa7b3e9d9bf"); insert into test.pfs_published_schema - values("MySQL 8.0.19", + values("MySQL 8.0.19", 80019, "f58dba20c4234c34cedfcacd3b9a295dcac77a09b79d5f41d5f740878f272d4d"); insert into test.pfs_published_schema - values("MySQL 8.0.20", + values("MySQL 8.0.20", 80020, "a9aa0ab4a94ca91622145d735e60bbb03577616970351032d3194d8bfd7a69c7"); insert into test.pfs_published_schema - values("MySQL 8.0.21", + values("MySQL 8.0.21", 80021, "112972e1f7d2b3a351a14979ecc3b419efc81e79dc029078a3a94955be218e5a"); insert into test.pfs_published_schema - values("MySQL 8.0.22", + values("MySQL 8.0.22", 80022, "55f21a1c75161f414bb75eb0f46c24becf15232dcf3938d4c80bc3361ecdedea"); insert into test.pfs_published_schema - values("MySQL 8.0.23", + values("MySQL 8.0.23", 80023, "6f3e7fc656953ea433e9c857619a3d5cb252bfc068291657c4b56acb7ef012e1"); insert into test.pfs_published_schema - values("MySQL 8.0.24", + values("MySQL 8.0.24", 80024, "223d896eddc7fc8b25b622edbc714a3493ceffe4dd694595c833e693e19db41f"); insert into test.pfs_published_schema - values("MySQL 8.0.25", + values("MySQL 8.0.25", 80025, "2c0f18a287586e591cf58a670c0768c72cf76b571173e7008e58fb59983fbd1f"); insert into test.pfs_published_schema - values("MySQL 8.0.27", + values("MySQL 8.0.27", 80027, "69d5f4536bc649b4a198a5d135c1619817889aa9eae4a7d1c7d8f0e06d89a79f"); insert into test.pfs_published_schema - values("MySQL 8.0.28", + values("MySQL 8.0.28", 80028, "493bc6b273f75ba7ace80a626a940757e2353dffabd52b6bde9781c938a2edcb"); insert into test.pfs_published_schema - values("MySQL 8.0.29", + values("MySQL 8.0.29", 80029, "73a49507e32a69a288febb39895e45da17f9aa7409146431a4d1ee5d4639aebc"); insert into test.pfs_published_schema - values("MySQL 8.0.30", + values("MySQL 8.0.30", 80030, "611d5a5a1e863c674f20a6afa078525c11b5b175dcb5b6537e1755e7923abe55"); insert into test.pfs_published_schema - values("MySQL 8.0.31", + values("MySQL 8.0.31", 80031, "3f3b1274f3924c5874cbe6dd331ab14217ec89ff0b378fef2305c1d7e1918630"); insert into test.pfs_published_schema - values("MySQL 8.0.32", + values("MySQL 8.0.32", 80032, "556baad25ce27574fea75370799eaca7877291d4b7b54c36e6ce54017bb4e927"); insert into test.pfs_published_schema - values("MySQL 8.0.33", + values("MySQL 8.0.33", 80033, "1182e14dbd5a25625152b84217f967e8733fc599efbb6e7f1e193eb3bc083123"); insert into test.pfs_published_schema - values("MySQL 8.2.0", + values("MySQL 8.2.0", 80200, "566f78af08ea40a489c9d7ccb0f398896f36d5bee49f621680b0fdf382660da4"); +# MySQL 8.3.0 was incorrectly published with PFS_DD_VERSION 80200, +# which is a bug. +# The tooling now detects this, to prevent similar bugs: +# +# --error ER_DUP_ENTRY +# insert into test.pfs_published_schema +# values("MySQL 8.3.0", 80200, +# "This should have been caught in 8.3.0"); + +# Correct entry insert into test.pfs_published_schema - values("MySQL 8.3.0", + values("MySQL 8.3.0", 80300, "e76782448cff7ad04f95786b1eaf47604c50678d28ac9cdad3e57bbe84bcee93"); create table test.pfs_check_table @@ -145,12 +166,13 @@ create table test.pfs_check_table delimiter $$; -create procedure test.pfs_check_proc() +create procedure test.pfs_check_proc(actual_dd_version integer) begin declare whole_schema longtext; declare max_length int; declare found_signature varchar(64); declare found_version varchar(20); + declare found_dd_version int; insert into test.pfs_check_table(t) select concat(CATALOG_NAME, "-", @@ -234,7 +256,9 @@ begin select SHA2(whole_schema, 256) into found_signature; - select version into found_version from test.pfs_published_schema + select version, pfs_dd_version + into found_version, found_dd_version + from test.pfs_published_schema where signature = found_signature; if found_version is null @@ -249,6 +273,10 @@ begin Make sure, by using now(), that this will not happen. See the comments in the MAINTAINER section of this test. */ + + select "YOU MUST READ THE MAINTAINER NOTES IN THIS TEST." + as MAINTAINER_ACTION_NEEDED, NOW() as "NOW"; + select concat("Unknown signature ", found_signature, ", fix PFS_DD_VERSION now (", @@ -259,8 +287,34 @@ begin end; end if; + if (actual_dd_version != found_dd_version) + then + begin + declare full_msg text; + + /* + Booby trap: actually verify that the PFS_DD_VERSION + declared in table test.pfs_published_schema corresponds to reality, + that is, that is corresponds to the PS_VERSION + contained in the data dictionary on disk. + */ + + select "YOU MUST READ THE MAINTAINER NOTES IN THIS TEST." + as MAINTAINER_ACTION_NEEDED, NOW() as "NOW"; + + select concat("Incoherent PFS_DD_VERSION ", + found_dd_version, + ", fix PFS_DD_VERSION now (", + now(), + ")") into full_msg; + + signal sqlstate "50000" set message_text = full_msg; + end; + end if; + select concat("The tables in the performance_schema were last changed in ", - found_version) as "CHECK STATUS"; + found_version, ", with a PFS_DD_VERSION = ", + found_dd_version) as "CHECK STATUS"; end $$ @@ -269,7 +323,7 @@ delimiter ;$$ --echo "Checking the performance schema database structure ..." -call test.pfs_check_proc(); +call test.pfs_check_proc(@actual_dd_version); # Debug # select count(*) from test.pfs_check_table; diff --git a/mysql-test/suite/rpl/r/rpl_drop_binlog_ddl_skip_rewrite_2.result b/mysql-test/suite/rpl/r/rpl_drop_binlog_ddl_skip_rewrite_2.result new file mode 100644 index 000000000000..003cf850de68 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_drop_binlog_ddl_skip_rewrite_2.result @@ -0,0 +1,111 @@ +include/rpl/init_source_replica.inc +Warnings: +Note #### Sending passwords in plain text without SSL/TLS is extremely insecure. +Note #### Storing MySQL user name or password information in the connection metadata repository is not secure and is therefore not recommended. Please consider using the USER and PASSWORD connection options for START REPLICA; see the 'START REPLICA Syntax' in the MySQL Manual for more information. +[connection master] +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +CREATE TABLE t3 (a INT); +CREATE TABLE t4 (a INT); +include/rpl/sync_to_replica.inc +[connection master] + +# +# Test-1: Dropping tables from the connection which has +# binlog_ddl_skip_rewrite=ON +# +SET binlog_ddl_skip_rewrite = ON; +DROP /* comment1 */ TABLE t1; +include/rpl/mysqlbinlog.inc +Executed query: DROP /* comment1 */ TABLE t1 +Logged query: DROP /* comment1 */ TABLE t1 +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/; + +# +# Test-2: Dropping tables from the connection which has +# binlog_ddl_skip_rewrite=ON +# +[connection master1] +DROP /* comment2 */ TABLE t2; +include/rpl/mysqlbinlog.inc +Executed query: DROP /* comment2 */ TABLE t2 +Logged query: DROP TABLE `t2` /* generated by server */ +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/; + +# +# Test-3: Continue dropping tables from the connection which has +# binlog_ddl_skip_rewrite=ON +# +[connection master] +DROP /* comment3 */ TABLE t3; +include/rpl/mysqlbinlog.inc +Executed query: DROP /* comment3 */ TABLE t3 +Logged query: DROP /* comment3 */ TABLE t3 +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/; + +# +# Test-4: Dropping tables from the connection which has +# binlog_ddl_skip_rewrite=OFF +# +SET binlog_ddl_skip_rewrite = OFF; +DROP /* comment4 */ TABLE t4;; +include/rpl/mysqlbinlog.inc +Executed query: DROP /* comment4 */ TABLE t4; +Logged query: DROP TABLE `t4` /* generated by server */ +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/; +include/rpl/deprecated/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +master-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT) +master-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT) +master-bin.000001 # Query # # use `test`; CREATE TABLE t4 (a INT) +master-bin.000001 # Query # # use `test`; DROP /* comment1 */ TABLE t1 +master-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ +master-bin.000001 # Query # # use `test`; DROP /* comment3 */ TABLE t3 +master-bin.000001 # Query # # use `test`; DROP TABLE `t4` /* generated by server */ +include/rpl/sync_to_replica.inc +include/rpl/deprecated/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t4 (a INT) +slave-bin.000001 # Query # # use `test`; DROP /* comment1 */ TABLE t1 +slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ +slave-bin.000001 # Query # # use `test`; DROP /* comment3 */ TABLE t3 +slave-bin.000001 # Query # # use `test`; DROP TABLE `t4` /* generated by server */ + +# +# Test-5: Binlog replay +# +[connection master] +# Dump the binlog events into a file. +include/rpl/mysqlbinlog.inc +[connection slave] +include/rpl/stop_replica.inc +RESET BINARY LOGS AND GTIDS; +include/rpl/start_replica.inc +# Perform the replay. +include/rpl/deprecated/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +slave-bin.000001 # Query # # use `test`; CREATE TABLE t1 (a INT) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t2 (a INT) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t3 (a INT) +slave-bin.000001 # Query # # use `test`; CREATE TABLE t4 (a INT) +slave-bin.000001 # Query # # use `test`; DROP /* comment1 */ TABLE t1 +slave-bin.000001 # Query # # use `test`; DROP TABLE `t2` /* generated by server */ +slave-bin.000001 # Query # # use `test`; DROP /* comment3 */ TABLE t3 +slave-bin.000001 # Query # # use `test`; DROP TABLE `t4` /* generated by server */ +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/; +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/; +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/; +include/rpl/mysqlbinlog.inc +Output: /*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/; +include/rpl/deinit.inc diff --git a/mysql-test/suite/rpl/t/rpl_drop_binlog_ddl_skip_rewrite_2.test b/mysql-test/suite/rpl/t/rpl_drop_binlog_ddl_skip_rewrite_2.test new file mode 100644 index 000000000000..0efcf6c44eb0 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_drop_binlog_ddl_skip_rewrite_2.test @@ -0,0 +1,266 @@ +# +# PS-7526 : Unexpected quoting and dropping of comments in DROP TABLE commands +# This is related to the PXC-specific fix f4e7fe1a0196b0482938aa1e340b8f226cd2c35d +# Fix DROP TABLE binlogging issue +# + +--source include/have_util_sed.inc +--source include/have_grep.inc +--source include/have_binlog_format_row.inc +--source include/rpl/init_source_replica.inc + +# Create a few tables. +CREATE TABLE t1 (a INT); +CREATE TABLE t2 (a INT); +CREATE TABLE t3 (a INT); +CREATE TABLE t4 (a INT); + +--source include/rpl/sync_to_replica.inc +--source include/rpl/connection_source.inc + +# Save the binlog position before the test. +--let $MYSQLD_DATADIR= `SELECT @@datadir` +--let $binlog_fullpath= $MYSQLD_DATADIR/master-bin.000001 +--let $binlog_position= query_get_value("SHOW BINARY LOG STATUS", Position, 1) + +# Set the necessary variables used by the mysqlbinlog.inc +--let $mysqlbinlog_skip_binlog_statements= 1 +--let $mysqlbinlog_capture_output = 1 + +--echo +--echo # +--echo # Test-1: Dropping tables from the connection which has +--echo # binlog_ddl_skip_rewrite=ON +--echo # + +SET binlog_ddl_skip_rewrite = ON; + +--let $query = DROP /* comment1 */ TABLE t1 +--eval $query + +# Verify that the above DROP command is logged with comments. +--let $mysqlbinlog_pipe= | $GREP '^DROP' | $GREP 'comment1' +--source include/rpl/mysqlbinlog.inc + +--echo Executed query: $query +--echo Logged query: $result + +# Assert that the query is logged with comments +--assert (`SELECT '$result' = '$query'`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t1 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP .* t1' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Assert that value of @@binlog_ddl_skip_rewrite is also sent with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/;"`) + +--echo +--echo # +--echo # Test-2: Dropping tables from the connection which has +--echo # binlog_ddl_skip_rewrite=ON +--echo # + +# Change the connection and drop a few tables +--source include/rpl/connection_source1.inc + +# Assert that binlog_ddl_skip_rewrite = OFF +--assert (`SELECT @@binlog_ddl_skip_rewrite = 'OFF'`) + +# Save the binlog position. +--let $binlog_position= query_get_value("SHOW BINARY LOG STATUS", Position, 1) + +--let $query = DROP /* comment2 */ TABLE t2 +--eval $query + +# Verify that the above DROP command is logged without comments. +--let $mysqlbinlog_pipe= | $GREP '^DROP' | $GREP 'generated' +--source include/rpl/mysqlbinlog.inc + +--echo Executed query: $query +--echo Logged query: $result + +# Assert that executed query is different from logged query. +--assert (`SELECT '$result' != '$query'`) + +# Assert that rewritten query is logged in the binary log. +--assert (`SELECT 0 != LOCATE("generated by server", "$result")`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t2 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP TABLE .*t2' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Since the value of @@binlog_ddl_skip_rewrite is 0 for the second DROP TABLE, +# assert that value of @@binlog_ddl_skip_rewrite is also sent along with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/;"`) + +--echo +--echo # +--echo # Test-3: Continue dropping tables from the connection which has +--echo # binlog_ddl_skip_rewrite=ON +--echo # + +--source include/rpl/connection_source.inc +--let $binlog_position= query_get_value("SHOW BINARY LOG STATUS", Position, 1) + +--let $query = DROP /* comment3 */ TABLE t3 +--eval $query + +--let $mysqlbinlog_pipe= | $GREP '^DROP' | $GREP 'comment3' +--source include/rpl/mysqlbinlog.inc + +--echo Executed query: $query +--echo Logged query: $result + +# Assert that executed query is different from logged query. +--assert (`SELECT '$result' = '$query'`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t3 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP .* t3' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Assert that value of @@binlog_ddl_skip_rewrite is also sent with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/;"`) + +--echo +--echo # +--echo # Test-4: Dropping tables from the connection which has +--echo # binlog_ddl_skip_rewrite=OFF +--echo # + +# Disable binlog_ddl_skip_rewrite and drop a table. +--let $binlog_position= query_get_value("SHOW BINARY LOG STATUS", Position, 1) +SET binlog_ddl_skip_rewrite = OFF; + +--let $query = DROP /* comment4 */ TABLE t4; +--eval $query + +# Verify that the above DROP command is logged without comments. +--let $mysqlbinlog_pipe= | $GREP '^DROP' | $GREP 'generated' +--source include/rpl/mysqlbinlog.inc + +--echo Executed query: $query +--echo Logged query: $result + +# Assert that executed query is different from logged query. +--assert (`SELECT '$result' != '$query'`) + +# Assert that rewritten query is logged in the binary log. +--assert (`SELECT 0 != LOCATE("generated by server", "$result")`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t4 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP TABLE .*t4' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Since the value of @@binlog_ddl_skip_rewrite is 0 for the fourth DROP TABLE, +# assert that value of @@binlog_ddl_skip_rewrite is also sent along with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/;"`) + +# Display the contents of binary logs of both source and replica servers. +--source include/rpl/deprecated/show_binlog_events.inc +--source include/rpl/sync_to_replica.inc +--source include/rpl/deprecated/show_binlog_events.inc + +--echo +--echo # +--echo # Test-5: Binlog replay +--echo # + +--source include/rpl/connection_source.inc + +--let $MYSQLD_DATADIR= `SELECT @@datadir` +--let $mysqlbinlog_pipe= +--let $binlog_fullpath= +--let $binlog_position= + +--let $MYSQLBINLOG_OUTFILE=$MYSQLTEST_VARDIR/tmp/ps_7526_mysqlbinlog.sql +--let $mysqlbinlog_parameters= --result-file=$MYSQLBINLOG_OUTFILE --local-load=$MYSQLTEST_VARDIR/tmp/ $MYSQLD_DATADIR/master-bin.000001 +--let $WAIT_COUNT=6000 + +--echo # Dump the binlog events into a file. +--source include/rpl/mysqlbinlog.inc + + +# Clear all binary logs on replica server. +--source include/rpl/connection_replica.inc +--source include/rpl/stop_replica.inc +RESET BINARY LOGS AND GTIDS; +--source include/rpl/start_replica.inc + +--echo # Perform the replay. +--exec $MYSQL_SLAVE -c < $MYSQLBINLOG_OUTFILE + + +--source include/rpl/deprecated/show_binlog_events.inc + +# Verify that @@session.binlog_ddl_skip_rewrite is written on replica server's binary log as well. +--let $MYSQLD2_DATADIR= `SELECT @@datadir` +--let $binlog_fullpath= $MYSQLD2_DATADIR/slave-bin.000001 +--let $binlog_position= query_get_value("SHOW BINARY LOG STATUS", Position, 1) + +# Set the necessary variables used by the mysqlbinlog.inc +--let $mysqlbinlog_skip_binlog_statements= 1 +--let $mysqlbinlog_capture_output = 1 +--let $mysqlbinlog_parameters= + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t1 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP .* t1' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Assert that value of @@binlog_ddl_skip_rewrite is also sent with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/;"`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t2 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP TABLE .*t2' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Since the value of @@binlog_ddl_skip_rewrite is 0 for the second DROP TABLE, +# assert that value of @@binlog_ddl_skip_rewrite is also sent along with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/;"`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t3 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP .* t3' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Assert that value of @@binlog_ddl_skip_rewrite is also sent with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=1*//*!*/;"`) + +# Verify that the value of @@binlog_ddl_skip_rewrite is also sent with the DROP TABLE t4 query. +--let $binlog_position= +--let $mysqlbinlog_pipe= | $GREP 'DROP TABLE .*t4' -B1 | $GREP 'binlog_ddl_skip_rewrite' +--source include/rpl/mysqlbinlog.inc + +--echo Output: $result + +# Since the value of @@binlog_ddl_skip_rewrite is 0 for the fourth DROP TABLE, +# assert that value of @@binlog_ddl_skip_rewrite is also sent along with the query. +--assert (`SELECT '$result' = "/*!80026 SET @@session.binlog_ddl_skip_rewrite=0*//*!*/;"`) + +# Cleanup +--let $mysqlbinlog_pipe= +--let $binlog_fullpath= +--let $binlog_position= +--remove_file $MYSQLBINLOG_OUTFILE + +--source include/rpl/deinit.inc diff --git a/percona-xtradb-cluster-galera b/percona-xtradb-cluster-galera index 414c9fdc4fbc..57a4eaf8c9cf 160000 --- a/percona-xtradb-cluster-galera +++ b/percona-xtradb-cluster-galera @@ -1 +1 @@ -Subproject commit 414c9fdc4fbc551906ff6ee6d1186d67ca5f3b35 +Subproject commit 57a4eaf8c9cf6210777fb9ef02687ff033c30127 diff --git a/scripts/systemd/mysqld_pre_systemd.in b/scripts/systemd/mysqld_pre_systemd.in index 7ddac94ceae3..2f672e660f13 100644 --- a/scripts/systemd/mysqld_pre_systemd.in +++ b/scripts/systemd/mysqld_pre_systemd.in @@ -32,7 +32,7 @@ get_option () { local default=$3 local instance=$4 ret=$(@bindir@/my_print_defaults ${instance:+--defaults-group-suffix=@$instance} $section | \ - grep '^--'${option}'=' | cut -d= -f2- | tail -n 1) + grep '^--'${option}'=' | cut -d= -f2- | tail -n 1) [ -z "$ret" ] && ret=$default echo $ret } @@ -46,161 +46,6 @@ install_validate_password_sql_file () { echo $initfile } -<<<<<<< HEAD -||||||| merged common ancestors -my_which () { - save_ifs="${IFS-UNSET}" - IFS=: - ret=0 - for file - do - for dir in $PATH - do - if [ -f "$dir/$file" ] - then - echo "$dir/$file" - continue 2 - fi - done - - ret=1 #signal an error - break - done - - if [ "$save_ifs" = UNSET ] - then - unset IFS - else - IFS="$save_ifs" - fi - return $ret # Success -} - -fix_flush_caches() { - local instance=$1 - flush_caches=$(get_option mysqld_safe flush_caches "0" $instance) - if [ ${flush_caches} = 1 ]; then - if [ ! $(my_which sync) ]; then - echo "sync command not found, required for --flush-caches" - exit 1 - # Flush file system buffers. - else - sync - ret=$? - if [ $ret -ne 0 ]; then - # Huh, the sync() function is always successful... - echo "sync failed, check if sync is properly installed" - fi - fi - - # Locate sysctl, ensure it exists. - if [ ! $(my_which sysctl) ]; then - echo "sysctl command not found, required for --flush-caches" - exit 1 - # Purge page cache, dentries and inodes. - else - sysctl -q -w vm.drop_caches=3 - ret=$? - if [ $ret -ne 0 ]; then - echo "sysctl failed, check the error message for details" - exit 1 - fi - fi - fi -} - -fix_thp_setting() { - [ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql - # If no THP_SETTING variable specified in /etc/sysconfig/mysql don't do anything - if [ ! -z "${THP_SETTING}" ]; then - # Set whatever option is specified in environment file - echo "${THP_SETTING}" > /sys/kernel/mm/transparent_hugepage/defrag - echo "${THP_SETTING}" > /sys/kernel/mm/transparent_hugepage/enabled - fi -} - -fix_mysql_upgrade_info () { - datadir=$(get_option mysqld datadir "/var/lib/mysql${instance:+-$instance}" $instance) - if [ -d "$datadir" ] && [ -O "$datadir/mysql_upgrade_info" ]; then - chown --reference="$datadir" "$datadir/mysql_upgrade_info" - if [ -x /usr/bin/chcon ]; then - /usr/bin/chcon --reference="$datadir" "$datadir/mysql_upgrade_info" > /dev/null 2>&1 - fi - fi -} - -======= -my_which () { - save_ifs="${IFS-UNSET}" - IFS=: - ret=0 - for file - do - for dir in $PATH - do - if [ -f "$dir/$file" ] - then - echo "$dir/$file" - continue 2 - fi - done - - ret=1 #signal an error - break - done - - if [ "$save_ifs" = UNSET ] - then - unset IFS - else - IFS="$save_ifs" - fi - return $ret # Success -} - -fix_flush_caches() { - local instance=$1 - flush_caches=$(get_option mysqld_safe flush_caches "0" $instance) - if [ ${flush_caches} = 1 ]; then - if [ ! $(my_which sync) ]; then - echo "sync command not found, required for --flush-caches" - exit 1 - # Flush file system buffers. - else - sync - ret=$? - if [ $ret -ne 0 ]; then - # Huh, the sync() function is always successful... - echo "sync failed, check if sync is properly installed" - fi - fi - - # Locate sysctl, ensure it exists. - if [ ! $(my_which sysctl) ]; then - echo "sysctl command not found, required for --flush-caches" - exit 1 - # Purge page cache, dentries and inodes. - else - sysctl -q -w vm.drop_caches=3 - ret=$? - if [ $ret -ne 0 ]; then - echo "sysctl failed, check the error message for details" - exit 1 - fi - fi - fi -} - -fix_thp_setting() { - [ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql - # If no THP_SETTING variable specified in /etc/sysconfig/mysql don't do anything - if [ ! -z "${THP_SETTING}" ]; then - # Set whatever option is specified in environment file - echo "${THP_SETTING}" > /sys/kernel/mm/transparent_hugepage/defrag - echo "${THP_SETTING}" > /sys/kernel/mm/transparent_hugepage/enabled - fi -} - fix_mysql_upgrade_history () { datadir=$(get_option mysqld datadir "/var/lib/mysql${instance:+-$instance}" $instance) if [ -d "$datadir" ] && [ -O "$datadir/mysql_upgrade_history" ]; then @@ -211,20 +56,12 @@ fix_mysql_upgrade_history () { fi } ->>>>>>> ps/release-8.4.0-1 install_db () { # Note: something different than datadir=/var/lib/mysql requires SELinux policy changes (in enforcing mode) -<<<<<<< HEAD -||||||| merged common ancestors - # mysql_upgrade_info file should be owned by mysql user since MySQL 8.0.16 - fix_mysql_upgrade_info - -======= # mysql_upgrade_history file should be owned by mysql user since MySQL 8.4 (new file in 8.4) fix_mysql_upgrade_history ->>>>>>> ps/release-8.4.0-1 # No automatic init wanted [ -e /etc/sysconfig/mysql ] && . /etc/sysconfig/mysql [ -n "$NO_INIT" ] && exit 0 @@ -236,25 +73,25 @@ install_db () { # Restore log, dir, perms and SELinux contexts if [ ! -d "$datadir" -a ! -h "$datadir" -a "x$(dirname "$datadir")" = "x/var/lib" ]; then - install -d -m 0751 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$datadir" || exit 1 + install -d -m 0751 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$datadir" || exit 1 fi if [ ! -e "$log" -a ! -h "$log" -a x$(dirname "$log") = "x/var/log" ]; then - case $(basename "$log") in - mysql*.log) install /dev/null -m0640 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$log" ;; - *) ;; - esac + case $(basename "$log") in + mysql*.log) install /dev/null -m0640 -o@MYSQLD_USER@ -g@MYSQLD_USER@ "$log" ;; + *) ;; + esac fi if [ -x /usr/sbin/restorecon ]; then /usr/sbin/restorecon "$datadir" [ -e "$log" ] && /usr/sbin/restorecon "$log" - for dir in /var/lib/mysql-files /var/lib/mysql-keyring ; do + for dir in /var/lib/mysql-files /var/lib/mysql-keyring ; do if [ -x /usr/sbin/semanage -a -d /var/lib/mysql -a -d $dir ] ; then /usr/sbin/semanage fcontext -a -e /var/lib/mysql $dir >/dev/null 2>&1 /sbin/restorecon -r $dir fi - done + done fi # If special mysql dir is in place, skip db install @@ -263,24 +100,14 @@ install_db () { # Create initial db and install validate_password plugin initfile="$(install_validate_password_sql_file)" @libexecdir@/mysqld ${instance:+--defaults-group-suffix=@$instance} --initialize \ - --datadir="$datadir" --user=@MYSQLD_USER@ --init-file="$initfile" + --datadir="$datadir" --user=@MYSQLD_USER@ --init-file="$initfile" rm -f "$initfile" -<<<<<<< HEAD # Generate certs if needed if [ -x @bindir@/mysql_ssl_rsa_setup -a ! -e "${datadir}/server-key.pem" ] ; then @bindir@/mysql_ssl_rsa_setup --datadir="$datadir" --uid=@MYSQLD_USER@ >/dev/null 2>&1 fi return 0 -||||||| merged common ancestors - # Generate certs if needed - if [ -x @bindir@/mysql_ssl_rsa_setup -a ! -e "${datadir}/server-key.pem" ] ; then - @bindir@/mysql_ssl_rsa_setup --datadir="$datadir" --uid=@MYSQLD_USER@ >/dev/null 2>&1 - fi - exit 0 -======= - exit 0 ->>>>>>> ps/release-8.4.0-1 } get_recover_pos () { diff --git a/scripts/wsrep_sst_xtrabackup-v2.sh b/scripts/wsrep_sst_xtrabackup-v2.sh index 2aa3f804f64f..830351b575cb 100755 --- a/scripts/wsrep_sst_xtrabackup-v2.sh +++ b/scripts/wsrep_sst_xtrabackup-v2.sh @@ -829,7 +829,6 @@ read_cnf() # (These files will not be REMOVED on the joiner node) cpat=$(parse_cnf sst cpat '.*\.pem$\|.*init\.ok$\|.*galera\.cache$\|.*sst_in_progress$\|.*sst-xb-tmpdir$\|.*gvwstate\.dat$\|.*grastate\.dat$\|.*\.err$\|.*\.log$\|.*RPM_UPGRADE_MARKER$\|.*RPM_UPGRADE_HISTORY$\|.*component_keyring_.*\.cnf$\|.*mysqld.my$') - # Keep the KEYRING_FILE_DIR if it is a subdir of the datadir # Normalize the datadir for comparison # Retry the connection 30 times (at 1-second intervals) @@ -1653,9 +1652,6 @@ function initialize_pxb_commands() disver="--no-version-check" fi - # KH: TODO: Just for tests, as we don't have PXB 8.4 yet. Remove it - disver+=" --no-server-version-check" - local xb_version=$(${pxb_bin_path} --version 2>&1 | grep -oe ' [0-9]\.[0-9][\.0-9]*' | head -n1) xb_version=${xb_version# } wsrep_log_debug "pxb-version:$xb_version" @@ -1789,10 +1785,9 @@ if [[ -z $MYSQL_VERSION ]]; then fi # Verify PXB versions we have -# KH: temporary -#verify_pxb_version "${XTRABACKUP_THIS_VER_PATH}" "${XB_THIS_REQUIRED_VERSION}" -#verify_pxb_version "${XTRABACKUP_PREV_VER_PATH}" "${XB_PREV_REQUIRED_VERSION}" -#verify_pxb_version "${XTRABACKUP_PREV_LTS_VER_PATH}" "${XB_PREV_LTS_REQUIRED_VERSION}" +verify_pxb_version "${XTRABACKUP_THIS_VER_PATH}" "${XB_THIS_REQUIRED_VERSION}" +verify_pxb_version "${XTRABACKUP_PREV_VER_PATH}" "${XB_PREV_REQUIRED_VERSION}" +verify_pxb_version "${XTRABACKUP_PREV_LTS_VER_PATH}" "${XB_PREV_LTS_REQUIRED_VERSION}" rm -f "${XB_GTID_INFO_FILE_PATH}"