Fix two bugs in tsquery @> operator.
authorHeikki Linnakangas
Mon, 27 Oct 2014 08:50:41 +0000 (10:50 +0200)
committerHeikki Linnakangas
Mon, 27 Oct 2014 08:51:29 +0000 (10:51 +0200)
commit1aa526f3f18feb2434870b1f1c78cfc0aa87d56f
tree3deee4730acf6acb49b3f45179f404eaf16850de
parentf6abf8f08ac36825e3cbcaf6ef923822e65877f4
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.
src/backend/utils/adt/tsquery_op.c