diff --git a/META.json b/META.json index be3b162..92e66a5 100644 --- a/META.json +++ b/META.json @@ -2,7 +2,7 @@ "name": "pg_stat_monitor", "abstract": "PostgreSQL Query Performance Monitoring Tool", "description": "pg_stat_monitor is a PostgreSQL Query Performance Monitoring tool, based on PostgreSQL's contrib module pg_stat_statements. PostgreSQL’s pg_stat_statements provides the basic statistics, which is sometimes not enough. The major shortcoming in pg_stat_statements is that it accumulates all the queries and their statistics and does not provide aggregated statistics nor histogram information. In this case, a user would need to calculate the aggregates, which is quite an expensive operation.", - "version": "2.3.0", + "version": "2.3.1", "maintainer": [ "Artem Gavrilov ", "Diego dos Santos Fronza " @@ -15,7 +15,7 @@ "abstract": "PostgreSQL Query Performance Monitoring Tool", "file": "pg_stat_monitor--2.2--2.3.sql", "docfile": "README.md", - "version": "2.3.0" + "version": "2.3.1" } }, "prereqs": { diff --git a/percona-packaging/scripts/pg_stat_monitor_builder.sh b/percona-packaging/scripts/pg_stat_monitor_builder.sh index 8d05077..56c095f 100755 --- a/percona-packaging/scripts/pg_stat_monitor_builder.sh +++ b/percona-packaging/scripts/pg_stat_monitor_builder.sh @@ -213,12 +213,12 @@ install_deps() { if [ x"$RHEL" = x8 ]; then - clang_version=$(yum list --showduplicates clang-devel | grep "17.0" | grep clang | awk '{print $2}' | head -n 1) - llvm_version=$(yum list --showduplicates llvm-devel | grep "17.0" | grep llvm | awk '{print $2}' | head -n 1) - yum install -y clang-devel-${clang_version} clang-${clang_version} llvm-devel-${llvm_version} - dnf module -y disable llvm-toolset + clang_version=$(yum list --showduplicates clang-devel | grep "20.1" | grep clang | awk '{print $2}' | head -n 1) + llvm_version=$(yum list --showduplicates llvm-devel | grep "20.1" | grep llvm | awk '{print $2}' | head -n 1) + yum install -y clang-devel-${clang_version} clang-${clang_version} llvm-devel-${llvm_version} + dnf module disable -y rust-toolset llvm-toolset else - yum install -y clang-devel clang llvm-devel + yum install -y clang-devel clang llvm-devel fi PKGLIST="percona-postgresql${PG_RELEASE}-devel" diff --git a/pg_stat_monitor.c b/pg_stat_monitor.c index c7c983f..2338c06 100644 --- a/pg_stat_monitor.c +++ b/pg_stat_monitor.c @@ -43,7 +43,7 @@ typedef enum pgsmVersion PG_MODULE_MAGIC; -#define BUILD_VERSION "2.3.0" +#define BUILD_VERSION "2.3.1" /* Number of output arguments (columns) for various API versions */ #define PG_STAT_MONITOR_COLS_V1_0 52 @@ -82,7 +82,6 @@ void _PG_init(void); /* Current nesting depth of planner/ExecutorRun/ProcessUtility calls */ static int nesting_level = 0; -volatile bool __pgsm_do_not_capture_error = false; #if PG_VERSION_NUM < 170000 /* Before planner nesting level was conunted separately */ @@ -98,10 +97,10 @@ static int hist_bucket_count_total; static uint32 pgsm_client_ip = PGSM_INVALID_IP_MASK; -/* The array to store outer layer query id*/ -int64 *nested_queryids; -char **nested_query_txts; -List *lentries = NIL; +/* The array to store outer layer query id */ +static int64 *nested_queryids; +static char **nested_query_txts; +static List *lentries = NIL; static char relations[REL_LST][REL_LEN]; @@ -211,12 +210,12 @@ static void pgsm_cleanup_callback(void *arg); static void pgsm_store_error(const char *query, ErrorData *edata); /*---- Local variables ----*/ -MemoryContextCallback mem_cxt_reset_callback = +static MemoryContextCallback mem_cxt_reset_callback = { .func = pgsm_cleanup_callback, .arg = NULL }; -volatile bool callback_setup = false; +static volatile bool callback_setup = false; static void pgsm_update_entry(pgsmEntry *entry, const char *query, @@ -343,7 +342,7 @@ _PG_init(void) ExecutorCheckPerms_hook = HOOK(pgsm_ExecutorCheckPerms); nested_queryids = (int64 *) malloc(sizeof(int64) * max_stack_depth); - nested_query_txts = (char **) malloc(sizeof(char *) * max_stack_depth); + nested_query_txts = (char **) calloc(max_stack_depth, sizeof(char *)); system_init = true; } diff --git a/regression/expected/version.out b/regression/expected/version.out index deade3b..7a87d65 100644 --- a/regression/expected/version.out +++ b/regression/expected/version.out @@ -2,7 +2,7 @@ CREATE EXTENSION pg_stat_monitor; SELECT pg_stat_monitor_version(); pg_stat_monitor_version ------------------------- - 2.3.0 + 2.3.1 (1 row) DROP EXTENSION pg_stat_monitor;