From d44ea191f7920a5679da3cf3d703d64db25dcf70 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Thu, 6 Jan 2022 17:11:48 -0500 Subject: [PATCH] Correct PG version check for 10.0+ Evergreen's core search query sometimes needs an optimization fence around part of the query that filters on record attributes. This is due to naive mis-estimation of how common certain combinations of values will be in bibliographic data. This fence is implemented only on Postgres versions that have a particular system catalog table, so Evergreen has to test the Postgres version. This commit fixes the query used for that test so that it works with Postgres versions that have more than one digit in the major version number, such as Postgres 10. Signed-off-by: Mike Rylander --- .../perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm index c4e345562e..6e51fce5c4 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/Application/Storage/Driver/Pg/QueryParser.pm @@ -772,7 +772,7 @@ sub dynamic_filter_compile { $negate = $negate ? '!' : ''; if (!$_pg_version) { - ($_pg_version = $e->json_query({from => ['version']})->[0]->{version}) =~ s/^.+?(\d\.\d).+$/$1/; + ($_pg_version = $e->json_query({from => ['version']})->[0]->{version}) =~ s/^.+?(\d+\.\d+).+$/$1/; } my $common = 0; -- 2.11.0