1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-27 07:42:10 +03:00

Teach hash_ok_operator() that record_eq is only sometimes hashable.

The need for this was foreseen long ago, but when record_eq
actually became hashable (in commit 01e658fa7), we missed updating
this spot.

Per bug #17363 from Elvis Pranskevichus.  Back-patch to v14 where
the faulty commit came in.

Discussion: https://postgr.es/m/17363-f6d42fd0d726be02@postgresql.org
This commit is contained in:
Tom Lane
2022-01-16 16:39:26 -05:00
parent fe75517443
commit 6478896675
3 changed files with 36 additions and 3 deletions

View File

@@ -848,10 +848,10 @@ hash_ok_operator(OpExpr *expr)
/* quick out if not a binary operator */
if (list_length(expr->args) != 2)
return false;
if (opid == ARRAY_EQ_OP)
if (opid == ARRAY_EQ_OP ||
opid == RECORD_EQ_OP)
{
/* array_eq is strict, but must check input type to ensure hashable */
/* XXX record_eq will need same treatment when it becomes hashable */
/* these are strict, but must check input type to ensure hashable */
Node *leftarg = linitial(expr->args);
return op_hashjoinable(opid, exprType(leftarg));