Fix integer overflow (#435)

* Fix MAX_BUCKETS_MEM overflow

* Fix MAX_QUERY_BUF overflow

* Fix int overflow in IsBucketValid function

* Add missing newline

* Remove test for max value of pgsm_query_shared_buffer parameter

* Tune tests

* Cleanup

* Use int64 type instead of long long
This commit is contained in:
Artem Gavrilov
2024-04-05 14:34:30 +02:00
committed by GitHub
parent 7ea569e6bc
commit 64c71f98de
10 changed files with 225 additions and 7 deletions

View File

@@ -19,7 +19,7 @@ my $pgdata = $node->data_dir;
# UPDATE postgresql.conf to include/load pg_stat_monitor library
open my $conf, '>>', "$pgdata/postgresql.conf";
print $conf "shared_preload_libraries = 'pg_stat_monitor'\n";
print $conf "pg_stat_monitor.pgsm_max = 1000\n";
print $conf "pg_stat_monitor.pgsm_max = 2048\n";
close $conf;
# Start server
@@ -62,7 +62,7 @@ PGSM::append_to_file($stdout);
ok($cmdret == 0, "Print PGSM EXTENSION Settings");
PGSM::append_to_file($stdout);
$node->append_conf('postgresql.conf', "pg_stat_monitor.pgsm_max = 10\n");
$node->append_conf('postgresql.conf', "pg_stat_monitor.pgsm_max = 10\n"); # Min possible value
$node->restart();
($cmdret, $stdout, $stderr) = $node->psql('postgres', 'SELECT pg_stat_monitor_reset();', extra_params => ['-a', '-Pformat=aligned','-Ptuples_only=off']);