pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
6+ messages / 1 participants
[nested] [flat]

* pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
@ 2017-01-26 17:18 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-01-26 17:18 UTC (permalink / raw)
  To: pgsql-committers

Ensure that a tsquery like '!foo' matches empty tsvectors.

!foo means "the tsvector does not contain foo", and therefore it should
match an empty tsvector.  ts_match_vq() overenthusiastically supposed
that an empty tsvector could never match any query, so it forcibly
returned FALSE, the wrong answer.  Remove the premature optimization.

Our behavior on this point was inconsistent, because while seqscans and
GIST index searches both failed to match empty tsvectors, GIN index
searches would find them, since GIN scans don't rely on ts_match_vq().
That makes this certainly a bug, not a debatable definition disagreement,
so back-patch to all supported branches.

Report and diagnosis by Tom Dunstan (bug #14515); added test cases by me.

Discussion: https://postgr.es/m/20170126025524.1434.97828@wrigleys.postgresql.org

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9d4ca01314ba0c571139c5560a40ef764ad0feee

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |   3 +-
src/test/regress/expected/tsearch.out | 137 ++++++++++++++++++++++++++++++++++
src/test/regress/expected/tstypes.out |  12 +++
src/test/regress/sql/tsearch.sql      |  33 ++++++++
src/test/regress/sql/tstypes.sql      |   2 +
5 files changed, 186 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
@ 2017-01-26 17:18 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-01-26 17:18 UTC (permalink / raw)
  To: pgsql-committers

Ensure that a tsquery like '!foo' matches empty tsvectors.

!foo means "the tsvector does not contain foo", and therefore it should
match an empty tsvector.  ts_match_vq() overenthusiastically supposed
that an empty tsvector could never match any query, so it forcibly
returned FALSE, the wrong answer.  Remove the premature optimization.

Our behavior on this point was inconsistent, because while seqscans and
GIST index searches both failed to match empty tsvectors, GIN index
searches would find them, since GIN scans don't rely on ts_match_vq().
That makes this certainly a bug, not a debatable definition disagreement,
so back-patch to all supported branches.

Report and diagnosis by Tom Dunstan (bug #14515); added test cases by me.

Discussion: https://postgr.es/m/20170126025524.1434.97828@wrigleys.postgresql.org

Branch
------
REL9_6_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2dfc12647138deadabfc32123692021b7dd9a94f

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |   3 +-
src/test/regress/expected/tsearch.out | 137 ++++++++++++++++++++++++++++++++++
src/test/regress/expected/tstypes.out |  12 +++
src/test/regress/sql/tsearch.sql      |  33 ++++++++
src/test/regress/sql/tstypes.sql      |   2 +
5 files changed, 186 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
@ 2017-01-26 17:18 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-01-26 17:18 UTC (permalink / raw)
  To: pgsql-committers

Ensure that a tsquery like '!foo' matches empty tsvectors.

!foo means "the tsvector does not contain foo", and therefore it should
match an empty tsvector.  ts_match_vq() overenthusiastically supposed
that an empty tsvector could never match any query, so it forcibly
returned FALSE, the wrong answer.  Remove the premature optimization.

Our behavior on this point was inconsistent, because while seqscans and
GIST index searches both failed to match empty tsvectors, GIN index
searches would find them, since GIN scans don't rely on ts_match_vq().
That makes this certainly a bug, not a debatable definition disagreement,
so back-patch to all supported branches.

Report and diagnosis by Tom Dunstan (bug #14515); added test cases by me.

Discussion: https://postgr.es/m/20170126025524.1434.97828@wrigleys.postgresql.org

Branch
------
REL9_5_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/423ad86f422397ce145cc3f5b3e56d2a11ccb6a6

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |   3 +-
src/test/regress/expected/tsearch.out | 137 ++++++++++++++++++++++++++++++++++
src/test/regress/expected/tstypes.out |  12 +++
src/test/regress/sql/tsearch.sql      |  33 ++++++++
src/test/regress/sql/tstypes.sql      |   3 +
5 files changed, 187 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
@ 2017-01-26 17:18 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-01-26 17:18 UTC (permalink / raw)
  To: pgsql-committers

Ensure that a tsquery like '!foo' matches empty tsvectors.

!foo means "the tsvector does not contain foo", and therefore it should
match an empty tsvector.  ts_match_vq() overenthusiastically supposed
that an empty tsvector could never match any query, so it forcibly
returned FALSE, the wrong answer.  Remove the premature optimization.

Our behavior on this point was inconsistent, because while seqscans and
GIST index searches both failed to match empty tsvectors, GIN index
searches would find them, since GIN scans don't rely on ts_match_vq().
That makes this certainly a bug, not a debatable definition disagreement,
so back-patch to all supported branches.

Report and diagnosis by Tom Dunstan (bug #14515); added test cases by me.

Discussion: https://postgr.es/m/20170126025524.1434.97828@wrigleys.postgresql.org

Branch
------
REL9_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2c1976a6cc4bc2447bfd1e422c5b9ebf2a4d893f

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |   3 +-
src/test/regress/expected/tsearch.out | 137 ++++++++++++++++++++++++++++++++++
src/test/regress/expected/tstypes.out |  12 +++
src/test/regress/sql/tsearch.sql      |  33 ++++++++
src/test/regress/sql/tstypes.sql      |   3 +
5 files changed, 187 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
@ 2017-01-26 17:18 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-01-26 17:18 UTC (permalink / raw)
  To: pgsql-committers

Ensure that a tsquery like '!foo' matches empty tsvectors.

!foo means "the tsvector does not contain foo", and therefore it should
match an empty tsvector.  ts_match_vq() overenthusiastically supposed
that an empty tsvector could never match any query, so it forcibly
returned FALSE, the wrong answer.  Remove the premature optimization.

Our behavior on this point was inconsistent, because while seqscans and
GIST index searches both failed to match empty tsvectors, GIN index
searches would find them, since GIN scans don't rely on ts_match_vq().
That makes this certainly a bug, not a debatable definition disagreement,
so back-patch to all supported branches.

Report and diagnosis by Tom Dunstan (bug #14515); added test cases by me.

Discussion: https://postgr.es/m/20170126025524.1434.97828@wrigleys.postgresql.org

Branch
------
REL9_3_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2e024f83bd428fe32a2284452f31288c163a1190

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |   3 +-
src/test/regress/expected/tsearch.out | 137 ++++++++++++++++++++++++++++++++++
src/test/regress/expected/tstypes.out |  12 +++
src/test/regress/sql/tsearch.sql      |  33 ++++++++
src/test/regress/sql/tstypes.sql      |   3 +
5 files changed, 187 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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

* pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors.
@ 2017-01-26 17:18 Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 6+ messages in thread

From: Tom Lane @ 2017-01-26 17:18 UTC (permalink / raw)
  To: pgsql-committers

Ensure that a tsquery like '!foo' matches empty tsvectors.

!foo means "the tsvector does not contain foo", and therefore it should
match an empty tsvector.  ts_match_vq() overenthusiastically supposed
that an empty tsvector could never match any query, so it forcibly
returned FALSE, the wrong answer.  Remove the premature optimization.

Our behavior on this point was inconsistent, because while seqscans and
GIST index searches both failed to match empty tsvectors, GIN index
searches would find them, since GIN scans don't rely on ts_match_vq().
That makes this certainly a bug, not a debatable definition disagreement,
so back-patch to all supported branches.

Report and diagnosis by Tom Dunstan (bug #14515); added test cases by me.

Discussion: https://postgr.es/m/20170126025524.1434.97828@wrigleys.postgresql.org

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/fe6120f9b359d3ac20f235fbf9938bcd850b1598

Modified Files
--------------
src/backend/utils/adt/tsvector_op.c   |   3 +-
src/test/regress/expected/tsearch.out | 137 ++++++++++++++++++++++++++++++++++
src/test/regress/expected/tstypes.out |  12 +++
src/test/regress/sql/tsearch.sql      |  33 ++++++++
src/test/regress/sql/tstypes.sql      |   3 +
5 files changed, 187 insertions(+), 1 deletion(-)


-- 
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers


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


end of thread, other threads:[~2017-01-26 17:18 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2017-01-26 17:18 pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors. Tom Lane <tgl@sss.pgh.pa.us>
2017-01-26 17:18 pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors. Tom Lane <tgl@sss.pgh.pa.us>
2017-01-26 17:18 pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors. Tom Lane <tgl@sss.pgh.pa.us>
2017-01-26 17:18 pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors. Tom Lane <tgl@sss.pgh.pa.us>
2017-01-26 17:18 pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors. Tom Lane <tgl@sss.pgh.pa.us>
2017-01-26 17:18 pgsql: Ensure that a tsquery like '!foo' matches empty tsvectors. 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