pgsql: Fix cross-type case in partial row matching for hashed subplans.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix cross-type case in partial row matching for hashed subplans.
Дата
Msg-id E1TMLWt-0005CW-Rx@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix cross-type case in partial row matching for hashed subplans.

When hashing a subplan like "WHERE (a, b) NOT IN (SELECT x, y FROM ...)",
findPartialMatch() attempted to match rows using the hashtable's internal
equality operators, which of course are for x and y's datatypes.  What we
need to use are the potentially cross-type operators for a=x, b=y, etc.
Failure to do that leads to wrong answers or even crashes.  The scope for
problems is limited to cases where we have different types with compatible
hash functions (else we'd not be using a hashed subplan), but for example
int4 vs int8 can cause the problem.

Per bug #7597 from Bo Jensen.  This has been wrong since the hashed-subplan
code was written, so patch all the way back.

Branch
------
REL9_2_STABLE

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

Modified Files
--------------
src/backend/executor/nodeSubplan.c      |   17 +++++++++++------
src/test/regress/expected/subselect.out |   17 +++++++++++++++++
src/test/regress/sql/subselect.sql      |   15 +++++++++++++++
3 files changed, 43 insertions(+), 6 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix cross-type case in partial row matching for hashed subplans.
Следующее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix cross-type case in partial row matching for hashed subplans.