pgsql: Fix two bugs in tsquery @> operator.

From: Heikki Linnakangas <heikki(dot)linnakangas(at)iki(dot)fi>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix two bugs in tsquery @> operator.
Date: 2014-10-27 08:52:26
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix two bugs in tsquery @> operator.

1. The comparison for matching terms used only the CRC to decide if there's
a match. Two different terms with the same CRC gave a match.

2. It assumed that if the second operand has more terms than the first, it's
never a match. That assumption is bogus, because there can be duplicate
terms in either operand.

Rewrite the implementation in a way that doesn't have those bugs.

Backpatch to all supported versions.

Branch
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4d1c738d10c914729c9a08951ad546c8a6701664

Modified Files
--------------
src/backend/utils/adt/tsquery_op.c | 131 +++++++++++++++++++++++++-----------
1 file changed, 90 insertions(+), 41 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2014-10-27 10:24:01 Re: pgsql: Fix two bugs in tsquery @> operator.
Previous Message Bruce Momjian 2014-10-27 08:46:04 pgsql: Add variable names to two LWLock C prototypes