From 6d30d18834dd993363872f77efb0d7d858d2866c Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Wed, 20 Jun 2018 12:12:28 -0300 Subject: [PATCH] PT-1554 Fixed tests for rebuild_constraints in MySQL 8 --- t/pt-online-schema-change/basics.t | 4 ++-- t/pt-online-schema-change/rename_columns.t | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/t/pt-online-schema-change/basics.t b/t/pt-online-schema-change/basics.t index 978527b9..b23bec30 100644 --- a/t/pt-online-schema-change/basics.t +++ b/t/pt-online-schema-change/basics.t @@ -760,7 +760,7 @@ ok( ($output, $exit) = full_output( sub { pt_online_schema_change::main(@args, - "$dsn,D=sakila,t=actor", qw(--chunk-size-limit 0 --alter-foreign-keys-method drop_swap --execute --alter ENGINE=InnoDB)) }, + "$dsn,D=sakila,t=actor", qw(--chunk-size-limit 0 --alter-foreign-keys-method rebuild_constraints --execute --alter ENGINE=InnoDB)) }, stderr => 1, ); @@ -833,7 +833,7 @@ $sb->load_file('master', "$sample/create_dsns.sql"); ($output, $exit) = full_output( sub { pt_online_schema_change::main(@args, "$dsn,D=sakila,t=actor", ('--recursion-method=dsn=D=test_recursion_method,t=dsns,h=127.0.0.1,P=12345,u=msandbox,p=msandbox', - '--alter-foreign-keys-method', 'drop_swap', '--execute', '--alter', 'ENGINE=InnoDB')) + '--alter-foreign-keys-method', 'rebuild_constraints', '--execute', '--alter', 'ENGINE=InnoDB')) }, stderr => 1, ); diff --git a/t/pt-online-schema-change/rename_columns.t b/t/pt-online-schema-change/rename_columns.t index bf5f16fd..686eb641 100644 --- a/t/pt-online-schema-change/rename_columns.t +++ b/t/pt-online-schema-change/rename_columns.t @@ -117,7 +117,7 @@ my $mod2 = $master_dbh->selectall_arrayref(q{SELECT city FROM sakila.city}); is_deeply( $orig, $mod2, - "sakila.city: No date missing after second rename" + "sakila.city: No data missing after second rename" ); @@ -125,15 +125,19 @@ is_deeply( # Try with sakila.staff # ############################################################################# +diag("Reloading sakila"); +my $master_port = $sb->port_for('master'); +system "$trunk/sandbox/load-sakila-db $master_port"; +$sb->wait_for_slaves(); + $orig = $master_dbh->selectall_arrayref(q{SELECT first_name, last_name FROM sakila.staff}); ($output, $exit_status) = full_output( sub { pt_online_schema_change::main(@args, "$master_dsn,D=sakila,t=staff", "--alter", "change column first_name first_name_mod varchar(45) NOT NULL, change column last_name last_name_mod varchar(45) NOT NULL", - qw(--execute --alter-foreign-keys-method auto --no-check-alter)) }, + qw(--execute --alter-foreign-keys-method rebuild_constraints --no-check-alter)) }, ); - $mod = $master_dbh->selectall_arrayref(q{SELECT first_name_mod, last_name_mod FROM sakila.staff}); is_deeply(