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

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: BUG #17570: Unrecognized node type for query with statistics on expressions
Дата
Msg-id CAMbWs48FfgCZsA1URKboCHyNjXxDAZR=esFzwfRgqL+8H7+WBg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17570: Unrecognized node type for query with statistics on expressions  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: BUG #17570: Unrecognized node type for query with statistics on expressions  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

On Fri, Aug 5, 2022 at 8:49 AM Richard Guo <guofenglinux@gmail.com> wrote:
On Thu, Aug 4, 2022 at 11:42 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
* statext_is_compatible_clause_internal is not on board with
offsetting the attnums.
 
Correct. Good catch! Fix this in v2 patch.

I realized the fix in v2 is not correct. The attnums generated by
statext_is_compatible_clause is expected to be NOT offsetting by its
caller, i.e. statext_mcv_clauselist_selectivity. Revise that in v3 patch
by doing the offsetting when composing clause_attnums that need to have
permission check.
 
* 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.
 
That's true. We need to provide a better test case to cover this.

Also I'm trying to provide a better test case and at last come up with a
case in v3 like:

    SELECT * FROM tststats.priv_test_tbl where a = 1 and tststats.priv_test_tbl.* > (1, 1) is not null;

For this case, the clause 'a = 1' would cover that the attnum comes from
statext_is_compatible_clause_internal. And the clause 'priv_test_tbl.* >
(1, 1) is not null' would cover that the attnum comes from 'exprs' and
it has a whole-row reference.

Thanks
Richard 
Вложения

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

Предыдущее
От: Richard Guo
Дата:
Сообщение: Re: BUG #17570: Unrecognized node type for query with statistics on expressions
Следующее
От: "houzj.fnst@fujitsu.com"
Дата:
Сообщение: RE: No-op updates with partitioning and logical replication started failing in version 13