From 1855bc9f5c69f687951d98e9478475a67f2b24ce Mon Sep 17 00:00:00 2001 From: Artem Gavrilov Date: Thu, 6 Jun 2024 11:49:36 +0200 Subject: [PATCH] Fix t/028_temp_block.pl for PG14 and below --- t/028_temp_block.pl | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/t/028_temp_block.pl b/t/028_temp_block.pl index c1554d1..567fc68 100644 --- a/t/028_temp_block.pl +++ b/t/028_temp_block.pl @@ -91,13 +91,16 @@ is($stdout,'t',"Check: temp_blks_read should not be 0."); trim($stdout); is($stdout,'t',"Check: temp_blks_written should not be 0."); -($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.temp_blk_read_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); -trim($stdout); -is($stdout,'t',"Check: temp_blk_read_time should not be 0."); +if ($PGSM::PG_MAJOR_VERSION >= 15) +{ + ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.temp_blk_read_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); + trim($stdout); + is($stdout,'t',"Check: temp_blk_read_time should not be 0."); -($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.temp_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); -trim($stdout); -is($stdout,'t',"Check: temp_blk_write_time should not be 0."); + ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.temp_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']); + trim($stdout); + is($stdout,'t',"Check: temp_blk_write_time should not be 0."); +} # DROP EXTENSION $stdout = $node->safe_psql('postgres', 'DROP EXTENSION pg_stat_monitor;', extra_params => ['-a']);