pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix YA text phrase search bug.
5+ messages / 1 participants
[nested] [flat]

* pgsql: Fix YA text phrase search bug.
@ 2020-05-07 20:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-05-07 20:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/db89f0e3a45e98c1065355af75f41b5652333111

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix YA text phrase search bug.
@ 2020-05-07 20:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-05-07 20:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/e1d70ba438a29dd03ba1ce77dcb54c0df9c4f904

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix YA text phrase search bug.
@ 2020-05-07 20:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-05-07 20:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/5db48808c4d5c3641b76d442ba7e7d8916adadf4

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix YA text phrase search bug.
@ 2020-05-07 20:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-05-07 20:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/26cf16a9336101504c17e4bf7f6b6208c71bfa47

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* pgsql: Fix YA text phrase search bug.
@ 2020-05-07 20:00 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2020-05-07 20:00 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2020-05-07 20:00 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 20:00 pgsql: Fix YA text phrase search bug. Tom Lane <tgl@sss.pgh.pa.us>
2020-05-07 20:00 pgsql: Fix YA text phrase search bug. Tom Lane <tgl@sss.pgh.pa.us>
2020-05-07 20:00 pgsql: Fix YA text phrase search bug. Tom Lane <tgl@sss.pgh.pa.us>
2020-05-07 20:00 pgsql: Fix YA text phrase search bug. Tom Lane <tgl@sss.pgh.pa.us>
2020-05-07 20:00 pgsql: Fix YA text phrase search bug. Tom Lane <tgl@sss.pgh.pa.us>

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