From: Mike Rylander Date: Thu, 6 Jan 2022 22:11:48 +0000 (-0500) Subject: Correct PG version check for 10.0+ X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d44ea191f7920a5679da3cf3d703d64db25dcf70;p=working%2FEvergreen.git 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 --- 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;