PT-2340 - Support MySQL 8.4

- Adjusted tools and tests which fail due to fixed update-modules command
- Adjsted t/pt-table-checksum/basics.t test for 8.0
This commit is contained in:
Sveta Smirnova
2024-11-13 21:23:39 +03:00
parent bb66ab0845
commit 8b802722db
18 changed files with 67 additions and 48 deletions

View File

@@ -3445,7 +3445,7 @@ sub get_rules {
code => sub {
my ( %args ) = @_;
return _var_eq($args{variables}->{innodb_buffer_pool_size},
128 * 1_048_576); # 10M
128 * 1_048_576); # 128M
},
},
{
@@ -3502,7 +3502,7 @@ sub get_rules {
code => sub {
my ( %args ) = @_;
return _var_gt($args{variables}->{innodb_log_buffer_size},
64 * 1_048_576); # 16M
64 * 1_048_576); # 64M
},
},
{
@@ -3510,7 +3510,7 @@ sub get_rules {
code => sub {
my ( %args ) = @_;
return _var_eq($args{variables}->{innodb_log_file_size},
48 * 1_048_576); # 5M
48 * 1_048_576); # 48M
},
},
{

View File

@@ -2756,12 +2756,15 @@ sub main {
# If --pid, check it first since we'll die if it already exits.
# ########################################################################
my $daemon;
if ( $o->get('pid') ) {
if ( my $pid_file = $o->get('pid') ) {
# We're not daemoninzing, it just handles PID stuff. Keep $daemon
# in the the scope of main() because when it's destroyed it automatically
# removes the PID file.
$daemon = new Daemon(o=>$o);
$daemon->make_PID_file();
$daemon = new Daemon(
pid_file => $pid_file,
daemonize => 0,
);
$daemon->run();
}
# #######################################################################

View File

@@ -149,7 +149,7 @@ sub get_rules {
code => sub {
my ( %args ) = @_;
return _var_eq($args{variables}->{innodb_buffer_pool_size},
128 * 1_048_576); # 10M
128 * 1_048_576); # 128M
},
},
{
@@ -206,7 +206,7 @@ sub get_rules {
code => sub {
my ( %args ) = @_;
return _var_gt($args{variables}->{innodb_log_buffer_size},
64 * 1_048_576); # 16M
64 * 1_048_576); # 64M
},
},
{
@@ -214,7 +214,7 @@ sub get_rules {
code => sub {
my ( %args ) = @_;
return _var_eq($args{variables}->{innodb_log_file_size},
48 * 1_048_576); # 5M
48 * 1_048_576); # 48M
},
},
{

View File

@@ -118,7 +118,7 @@ my @cases = (
advice => [qw(innodb_additional_mem_pool_size)],
},
{ name => "innodb_buffer_pool_size",
vars => [qw(innodb_buffer_pool_size 10485760)],
vars => [qw(innodb_buffer_pool_size 134217728)],
advice => [qw(innodb_buffer_pool_size)],
},
{ name => "innodb checksums",
@@ -150,11 +150,11 @@ my @cases = (
advice => [qw(innodb_lock_wait_timeout)],
},
{ name => "innodb_log_buffer_size",
vars => [qw(innodb_log_buffer_size 17000000)],
vars => [qw(innodb_log_buffer_size 170000000)],
advice => [qw(innodb_log_buffer_size)],
},
{ name => "innodb_log_file_size",
vars => [qw(innodb_log_file_size 5242880)],
vars => [qw(innodb_log_file_size 50331648)],
advice => [qw(innodb_log_file_size)],
},
{ name => "innodb_max_dirty_pages_pct",
@@ -216,11 +216,15 @@ my @cases = (
},
{ name => "query_cache_size-1",
vars => [qw(query_cache_size 134217729)],
advice => [qw(query_cache_size-1)],
advice => [qw(query_cache_size-1 query_cache_size-3)],
},
{ name => "query_cache_size-2",
vars => [qw(query_cache_size 536870913)],
advice => [qw(query_cache_size-1 query_cache_size-2)],
advice => [qw(query_cache_size-1 query_cache_size-2 query_cache_size-3)],
},
{ name => "query_cache_size-3",
vars => [qw(query_cache_size 1024)],
advice => [qw(query_cache_size-3)],
},
{ name => "read_buffer_size-1",
vars => [qw(read_buffer_size 130000)],
@@ -336,8 +340,8 @@ my @cases = (
vars => [qw(myisam_recover_options DEFAULT)],
advice => [qw(myisam_recover_options)],
},
{ name => "storage_engine MyISAM",
vars => [qw(storage_engine MyISAM)],
{ name => "storage_engine InnoDB",
vars => [qw(storage_engine InnoDB)],
advice => [qw()],
},
{ name => "storage_engine",

View File

@@ -236,7 +236,7 @@ is(
like(
$output,
qr/Skipping replica h=127.0.0.1,P=12347/,
qr/Skipping ${replica_name} h=127.0.0.1,P=12347/,
'Broken replica skipped with --no-check-replica-tables and --skip-check-replica-lag'
);
@@ -265,7 +265,7 @@ is(
like(
$output,
qr/Skipping replica h=127.0.0.1,P=12347/,
qr/Skipping ${replica_name} h=127.0.0.1,P=12347/,
'Broken replica skipped with -no-check-slave-tables and --skip-check-replica-lag'
);

View File

@@ -22,30 +22,35 @@ my $output = '';
# ############################################################################
# Basic queries that parse without problems.
# ############################################################################
my $t;
use Data::Dumper;
ok(
no_diff(
sub { pt_table_usage::main(@args, "$in/slow001.txt") },
"$out/slow001.txt",
keep_output => 1,
),
'Analysis for slow001.txt'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
ok(
no_diff(
sub { pt_table_usage::main(@args, "$in/slow002.txt") },
"$out/slow002.txt",
keep_output => 1,
),
'Analysis for slow002.txt (issue 1237)'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
ok(
no_diff(
sub { pt_table_usage::main(@args, '--query',
'DROP TABLE IF EXISTS t') },
"$out/drop-table-if-exists.txt",
keep_output => 1,
),
'DROP TABLE IF EXISTS'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
ok(
no_diff(
@@ -58,9 +63,10 @@ ok(
SELECT c FROM t WHERE id=1")
},
"$out/create001.txt",
keep_output => 1,
),
'CREATE..SELECT'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
ok(
no_diff(
@@ -70,9 +76,10 @@ ok(
where b.type is null OR b.type=0")
},
"$out/query001.txt",
keep_output => 1,
),
'Multi-column USING'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
ok(
no_diff(
@@ -80,9 +87,10 @@ ok(
"SELECT dt.datetime, MAX(re.pd) AS pd FROM d1.t1 t1a INNER JOIN d2.t2 t2a ON CONCAT(t1.a, ' ', t2.a) = t1.datetime INNER JOIN d3.t3 t3a ON t1a.c = t3a.c GROUP BY t1.datetime");
},
"$out/query002.txt",
keep_output => 1,
),
'Function in JOIN clause'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
# ############################################################################
# --id-attribute
@@ -92,9 +100,10 @@ ok(
sub { pt_table_usage::main(@args, "$in/slow003.txt",
qw(--id-attribute ts)) },
"$out/slow003-003.txt",
keep_output => 1,
),
'Analysis for slow003.txt with --id-attribute'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
# ############################################################################
# --constant-data-value
@@ -128,9 +137,10 @@ ok(
no_diff(
sub { pt_table_usage::main(@args, "$in/slow003.txt") },
"$out/slow003-001.txt",
keep_output => 1,
),
'Analysis for slow003.txt'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
# #############################################################################
# Process fingerprints.

View File

@@ -31,9 +31,10 @@ ok(
'--create-table-definitions',
"$trunk/t/lib/samples/mysqldump-no-data/all-dbs.txt") },
"$out/create-table-defs-001.txt",
keep_output => 1,
),
'--create-table-definitions'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
# #############################################################################
# Done.

View File

@@ -47,9 +47,10 @@ ok(
no_diff(
sub { pt_table_usage::main(@args, qw(-D sakila), "$in/slow003.txt") },
"$out/slow003-002.txt",
keep_output => 1,
),
'EXPLAIN EXTENDED slow003.txt'
);
) or diag(`cat /tmp/percona-toolkit-test-output.txt`);
$output = output(
sub { pt_table_usage::main(@args, qw(-D sakila),

View File

@@ -1,4 +1,4 @@
Query_id: 0x1E0BF7001F0D58BB.1
Query_id: 0x0574833D9173C28E1E0BF7001F0D58BB.1
SELECT sakila.city
WHERE sakila.city

View File

@@ -1,4 +1,4 @@
Query_id: 0x9840C99F532C2E3F.1
Query_id: 0x557BA75BBDE73FF79840C99F532C2E3F.1
CREATE temp.5
SELECT t
WHERE t

View File

@@ -1,3 +1,3 @@
Query_id: 0xAED187CD505CBD92.1
Query_id: 0x37B0DFE8884D6089AED187CD505CBD92.1
DROP_TABLE t

View File

@@ -1,4 +1,4 @@
Query_id: 0xF318E3D2483D370E.1
Query_id: 0xAAB28F0DED7111E8F318E3D2483D370E.1
SELECT temp.temp6
JOIN temp.temp6
JOIN n.type

View File

@@ -1,4 +1,4 @@
Query_id: 0xF573BD7AD8CDDD7D.1
Query_id: 0xC1CFC950034A2070F573BD7AD8CDDD7D.1
JOIN d1.t1
JOIN d2.t2
JOIN d3.t3

View File

@@ -1,7 +1,7 @@
Query_id: 0xF28708D8F2920792.1
Query_id: 0x9F683436FE68935AF28708D8F2920792.1
SELECT t
Query_id: 0x09CB59D3450EF6E8.1
Query_id: 0xB8671B9CC6DAF29409CB59D3450EF6E8.1
SELECT t1
SELECT t2
SELECT t3
@@ -11,21 +11,21 @@ TLIST t2
TLIST t3
TLIST z
Query_id: 0xCF687AF9F2D5E248.1
Query_id: 0x87903DB6D81F906FCF687AF9F2D5E248.1
INSERT t
SELECT DUAL
Query_id: 0xF1FBC364588DC469.1
Query_id: 0x7E55D76AA45FD8A6F1FBC364588DC469.1
DELETE t
WHERE t
Query_id: 0x8745D03011B0E1CE.1
Query_id: 0x04C9C44F502569388745D03011B0E1CE.1
SELECT a
SELECT b
JOIN a
JOIN b
Query_id: 0xEB871CD2B5729EA1.1
Query_id: 0xEEA372545CD429D8EB871CD2B5729EA1.1
REPLACE t
SELECT DUAL

View File

@@ -1,37 +1,37 @@
Query_id: 0x6B1671EA6890F103.1
Query_id: 0xF5D127683D27705F6B1671EA6890F103.1
UPDATE t1
SELECT DUAL
JOIN t1
JOIN t2
WHERE t2
Query_id: 0x1CD27577D202A339.1
Query_id: 0xA995B5F99B04A3091CD27577D202A339.1
UPDATE t1
SELECT DUAL
JOIN t1
JOIN t2
WHERE t1
Query_id: 0x1CD27577D202A339.2
Query_id: 0xA995B5F99B04A3091CD27577D202A339.2
UPDATE t2
SELECT DUAL
JOIN t1
JOIN t2
WHERE t1
Query_id: 0xF4BEDD52BF14F91B.1
Query_id: 0xB70884469F708E8BF4BEDD52BF14F91B.1
UPDATE t1
SELECT DUAL
JOIN t1
JOIN t2
WHERE t2
Query_id: 0x1E62B5AB0DD828BF.1
Query_id: 0xD4D613F1950A4FBA1E62B5AB0DD828BF.1
INSERT t1
SELECT t2
WHERE t2
Query_id: 0xE25F88EDB02EA4A3.1
Query_id: 0x92012C240D4A4AA5E25F88EDB02EA4A3.1
INSERT t
SELECT a
SELECT b

View File

@@ -1,4 +1,4 @@
Query_id: 0x7C6C08E1FA6D7E73.1
Query_id: 0xA448EE97720569D37C6C08E1FA6D7E73.1
SELECT country
SELECT city
JOIN city

View File

@@ -1,4 +1,4 @@
Query_id: 0x7C6C08E1FA6D7E73.1
Query_id: 0xA448EE97720569D37C6C08E1FA6D7E73.1
SELECT sakila.country
SELECT sakila.city
JOIN sakila.city

View File

@@ -44,7 +44,7 @@ like(
my $output = `$trunk/bin/pt-visual-explain $trunk/t/pt-visual-explain/samples/simple_union.sql --format dump --pid /tmp/mk-script.pid 2>&1`;
like(
$output,
qr{PID file /tmp/mk-script.pid already exists},
qr{PID file /tmp/mk-script.pid exists},
'Dies if PID file already exists (issue 391)'
);
`rm -rf /tmp/mk-script.pid`;