Re: Issue with query_is_distinct_for() and grouping sets

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Issue with query_is_distinct_for() and grouping sets
Дата
Msg-id CAApHDvoDeKPZEUXzie71wGupUtcEdfXHjFNweWxgQ+DvYgsEAg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Issue with query_is_distinct_for() and grouping sets  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: Issue with query_is_distinct_for() and grouping sets
Список pgsql-hackers
On Thu, 23 Oct 2025 at 15:45, Richard Guo <guofenglinux@gmail.com> wrote:
>
> On Wed, Oct 22, 2025 at 6:25 PM Richard Guo <guofenglinux@gmail.com> wrote:
> > Attached is a patch along the lines of option #2.  The LCOV report
> > indicates that there is currently no test coverage for the "else if
> > (query->groupingSets)" branch in query_is_distinct_for().  This patch
> > also adds test cases to cover that branch.
>
> Here is an updated patch that includes a commit message and adds a new
> test case involving DISTINCT clause used with GROUP BY.

I've not reviewed the patch, so I'm assuming this is broken and your
fix is correct, but I did see your commit message says:

> No backpatch as this could result in plan changes.

If this is broken then it'll need to be backpatched as if that
function returns true when it should return false, then you could have
LEFT JOINs being removed when they shouldn't or joins being marked as
"Inner Unique" when they shouldn't, which could result in incorrect
query results.

David



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