Fix t/027_local_blocks.pl test for older PG versions
parent
60a03d1c94
commit
ffd9685a6e
|
@ -70,9 +70,13 @@ is($stdout,'t',"Check: local_blks_hit should not be 0.");
|
|||
trim($stdout);
|
||||
is($stdout,'t',"Check: local_blks_dirtied should not be 0.");
|
||||
|
||||
($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%INSERT INTO t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']);
|
||||
trim($stdout);
|
||||
is($stdout,'t',"Check: local_blk_write_time should not be 0.");
|
||||
if ($PGSM::PG_MAJOR_VERSION => 17)
|
||||
{
|
||||
($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_blk_write_time) != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%INSERT INTO t1%\'', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']);
|
||||
trim($stdout);
|
||||
is($stdout,'t',"Check: local_blk_write_time should not be 0.");
|
||||
}
|
||||
|
||||
|
||||
# Compare values for query 'SELECT * FROM t1'
|
||||
($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT PGSM.local_blks_hit != 0 FROM pg_stat_monitor AS PGSM WHERE PGSM.query LIKE \'%FROM t1%\';', extra_params => ['-Pformat=unaligned','-Ptuples_only=on']);
|
||||
|
@ -80,9 +84,12 @@ trim($stdout);
|
|||
is($stdout,'t',"Check: local_blks_hit should not be 0.");
|
||||
|
||||
# TODO: Find a way how to bypass cache and ger real block reads
|
||||
# if ($PGSM::PG_MAJOR_VERSION => 17)
|
||||
# {
|
||||
# ($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT SUM(PGSM.local_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: local_blk_read_time should not be 0.");
|
||||
# }
|
||||
|
||||
# DROP EXTENSION
|
||||
$stdout = $node->safe_psql('postgres', 'DROP EXTENSION pg_stat_monitor;', extra_params => ['-a']);
|
||||
|
|
Loading…
Reference in New Issue