Re: BUG #17570: Unrecognized node type for query with statistics on expressions - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17570: Unrecognized node type for query with statistics on expressions
Date
Msg-id 3508845.1659627758@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #17570: Unrecognized node type for query with statistics on expressions  (Japin Li <japinli@hotmail.com>)
Responses Re: BUG #17570: Unrecognized node type for query with statistics on expressions
Re: BUG #17570: Unrecognized node type for query with statistics on expressions
List pgsql-bugs
Japin Li <japinli@hotmail.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



pgsql-bugs by date:

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