From 4f017cc61acbbee2f6105d8dcb732fbd3541e655 Mon Sep 17 00:00:00 2001 From: Carlos Salguero Date: Fri, 22 Jun 2018 14:56:02 -0300 Subject: [PATCH] PT-1554 Fixed tests for MySQL 8 --- t/pt-table-checksum/issue_1485195.t | 2 +- t/pt-table-checksum/privs.t | 2 +- t/pt-table-checksum/samples/privs-bug-916168.sql | 3 ++- t/pt-table-sync/check_privs.t | 3 ++- t/pt-table-sync/master_master.t | 4 +++- t/pt-table-sync/pt-1256.t | 4 ++-- 6 files changed, 11 insertions(+), 7 deletions(-) diff --git a/t/pt-table-checksum/issue_1485195.t b/t/pt-table-checksum/issue_1485195.t index 8bf48f2c..85d01a37 100644 --- a/t/pt-table-checksum/issue_1485195.t +++ b/t/pt-table-checksum/issue_1485195.t @@ -42,7 +42,7 @@ $output = output( is( PerconaTest::count_checksum_results($output, 'rows'), - $sandbox_version ge '8.0' ? 30 : $sandbox_version lt '5.7' ? 24 : 25, + $sandbox_version ge '8.0' ? 29 : $sandbox_version lt '5.7' ? 24 : 25, "Large BLOB/TEXT/BINARY Checksum" ); diff --git a/t/pt-table-checksum/privs.t b/t/pt-table-checksum/privs.t index 103bf9a9..8ce5dc46 100644 --- a/t/pt-table-checksum/privs.t +++ b/t/pt-table-checksum/privs.t @@ -168,7 +168,7 @@ wait_until( # ############################################################################# # Bug 916168: bug in pt-table-checksum privileges check # ############################################################################# -diag(`/tmp/12345/use -u root < $trunk/t/pt-table-checksum/samples/privs-bug-916168.sql`); +diag(`/tmp/12345/use -u root < $trunk/ t/pt-table-checksum/samples/privs-bug-916168.sql`); $output = output( sub { $exit_status = pt_table_checksum::main(@args, diff --git a/t/pt-table-checksum/samples/privs-bug-916168.sql b/t/pt-table-checksum/samples/privs-bug-916168.sql index c58667db..0fcb2af4 100644 --- a/t/pt-table-checksum/samples/privs-bug-916168.sql +++ b/t/pt-table-checksum/samples/privs-bug-916168.sql @@ -1,4 +1,5 @@ -grant select, replication slave, replication client, super, process on *.* to 'test_user'@'%' identified by 'foo'; +CREATE USER 'test_user'@'%' identified by 'foo'; +grant select, replication slave, replication client, super, process on *.* to 'test_user'@'%'; grant all on percona.* to 'test_user'@'%'; create database if not exists percona; use percona; diff --git a/t/pt-table-sync/check_privs.t b/t/pt-table-sync/check_privs.t index 6c6dbffa..fdfd1e24 100644 --- a/t/pt-table-sync/check_privs.t +++ b/t/pt-table-sync/check_privs.t @@ -50,7 +50,8 @@ $slave_dbh->do('create table issue_907.t (i int)'); $slave_dbh->do('insert into issue_907.t values (1)'); # On 5.1 user needs SUPER to set binlog_format, which mk-table-sync does. -`/tmp/12345/use -uroot -e "GRANT SUPER, SELECT, UPDATE, SHOW DATABASES ON *.* TO 'test_907'\@'localhost' IDENTIFIED BY 'msandbox'"`; +`/tmp/12345/use -uroot -e "CREATE USER 'test_907'\@'localhost' IDENTIFIED BY 'msandbox'"`; +`/tmp/12345/use -uroot -e "GRANT SUPER, SELECT, UPDATE, SHOW DATABASES ON *.* TO 'test_907'\@'localhost'"`; #2) run again to see what output is like when it works chomp($output = output( diff --git a/t/pt-table-sync/master_master.t b/t/pt-table-sync/master_master.t index cb807fbf..85ea390a 100644 --- a/t/pt-table-sync/master_master.t +++ b/t/pt-table-sync/master_master.t @@ -9,7 +9,7 @@ BEGIN { use strict; use warnings FATAL => 'all'; use English qw(-no_match_vars); -use Test::More tests => 4; +use Test::More; use PerconaTest; use Sandbox; @@ -20,6 +20,8 @@ my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp); if ($sandbox_version ge '8.0') { plan skip_all => "TODO master master sandbox is failing with MySQL 8.0+. FIX ME !!!!"; +} else { + plan 4; } # ############################################################################# diff --git a/t/pt-table-sync/pt-1256.t b/t/pt-table-sync/pt-1256.t index 3fedfb2c..a92a4d8f 100644 --- a/t/pt-table-sync/pt-1256.t +++ b/t/pt-table-sync/pt-1256.t @@ -36,7 +36,7 @@ elsif ( !$slave1_dbh ) { plan skip_all => 'Cannot connect to sandbox slave2'; } else { - plan tests => 5; + plan tests => 4; } my ($output, $status); @@ -77,7 +77,7 @@ is( $row->{f2}, $want, "Character set is correct", -); +) or diag("Want '$want', got '$row->{f2}"); SKIP: { skip "Skipping in MySQL 8.0.4-rc since there is an error in the server itself", 1 if ($sandbox_version ge '8.0');