pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix YA text phrase search bug.
Date: Thu, 07 May 2020 20:00:07 +0000
Message-ID: <E1jWmgh-0001CM-0T@gemulon.postgresql.org> (raw)

Fix YA text phrase search bug.

checkcondition_str() failed to report multiple matches for a prefix
pattern correctly: it would dutifully merge the match positions, but
then after exiting that loop, if the last prefix-matching word had
had no suitable positions, it would report there were no matches.
The upshot would be failing to recognize a match that the query
should match.

It looks like you need all of these conditions to see the bug:
* a phrase search (else we don't ask for match position details)
* a prefix search item (else we don't get to this code)
* a weight restriction (else checkclass_str won't fail)

Noted while investigating a problem report from Pavel Borisov,
though this is distinct from the issue he was on about.

Back-patch to 9.6 where phrase search was added.

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/7c9d9aa5ca2dd9b7661b2a2de75a3b963f3bc17c

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |  8 +++++++-
src/test/regress/expected/tstypes.out | 18 ++++++++++++++++++
src/test/regress/sql/tstypes.sql      |  3 +++
3 files changed, 28 insertions(+), 1 deletion(-)



view thread (5+ messages)

Message-ID: <E1jWmgh-0001CM-0T@gemulon.postgresql.org>
Permalink:  ../E1jWmgh-0001CM-0T@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1jWmgh-0001CM-0T@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us
  Subject: Re: pgsql: Fix YA text phrase search bug.
  In-Reply-To: <E1jWmgh-0001CM-0T@gemulon.postgresql.org>
  References: <E1jWmgh-0001CM-0T@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox