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 <mrylander@gmail.com>
$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;