Re: BUG #17570: Unrecognized node type for query with statistics on expressions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Richard Guo <guofenglinux(at)gmail(dot)com>, a(dot)kozhemyakin(at)postgrespro(dot)ru, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17570: Unrecognized node type for query with statistics on expressions
Date: 2022-08-04 15:42:38
Message-ID: 3508845.1659627758@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Japin Li <japinli(at)hotmail(dot)com> writes:
> Attached to new patch add a test-case from Alexander Kozhemyakin.

It appears to me that this is actually very thoroughly broken.

* statext_is_compatible_clause_internal is not on board with
offsetting the attnums.

* Neither is this check for a whole-row reference (line 1628, in HEAD):

if (bms_is_member(InvalidAttrNumber, clause_attnums))

* Although the coverage report claims this code is exercised, the
fact that nothing failed when you made only a partial fix says it's
not exercised well enough.

* The comments for statext_is_compatible_clause suck. If they'd
defined what the arguments are, perhaps this mess would have been
prevented. For extra credit, it'd be really nice to define what
"is compatible" means. I'd sure not have thought that that would
include permissions checks.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David G. Johnston 2022-08-04 15:58:43 Re: ERROR: unterminated dollar-quoted string at or near "$$"
Previous Message Julien Rouhaud 2022-08-04 15:17:46 Re: BUG #17571: PostgreSQL 15b2 ICU collation defined at db level sorts differently in collate clause vs implicit