Re: v17 Possible Union All Bug

Alexander Korotkov <aekorotkov@gmail.com>

From: Alexander Korotkov <aekorotkov@gmail.com>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: David Rowley <dgrowleyml@gmail.com>, Alexander Korotkov <akorotkov@postgresql.org>, PostgreSQL Bug List <pgsql-bugs@lists.postgresql.org>
Date: 2024-01-29T21:45:24Z
Lists: pgsql-bugs
On Mon, Jan 29, 2024 at 11:32 PM David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Mon, Jan 29, 2024 at 9:19 AM David G. Johnston <david.g.johnston@gmail.com> wrote:
>>
>> On Fri, Jan 26, 2024 at 5:36 PM David Rowley <dgrowleyml@gmail.com> wrote:
>>>
>>> On Sat, 27 Jan 2024 at 13:19, David Rowley <dgrowleyml@gmail.com> wrote:
>>> > Are the results correct if you SET enable_presorted_aggregate=0;?
>>>
>>
>> Apparently I didn't reply-all...
>>
>> Yes, the problem goes away when I disabled presorted_aggregate
>>
>> I'll see if that knowledge can help build a better reproducer.
>>
>
> I've deferred doing a better reproducer for the moment, I reliably got:
> initdb
> psql --file ~/unionall-repro.sql
> psql -c 'select * from rolegraph.role_graph_broken;'
>
>   oid  | role_type |      rolname       | rolsuper |                administration
> -------+-----------+--------------------+----------+-----------------------------------------------
>  16390 | User      | u6_green_leader_su | f        | mog of g6a_fixedops_manager_su from superuser+
>        |           |                    |          | mog of g6c_service_manager_su from superuser +
>        |           |                    |          | mog of g6d_service_advisor_su from superuser +
>        |           |                    |          | mog of g6e_service_tech_su from superuser    +
>        |           |                    |          | mog of g6c_service_manager_su from cr_admin
> (1 row)
>
> to be produced for the bad bisect result and the correct nested result for *manager* to produce on the good result.


Thank you for noticing.  I'm investigating this.

------
Regards,
Alexander Korotkov



Commits

  1. Fix usage of aggregate pathkeys in group_keys_reorder_by_pathkeys()

  2. Move is_valid_ascii() to ascii.h.

  3. Test EXPLAIN (FORMAT JSON) ... XMLTABLE

  4. Add test module injection_points

  5. Fix table name collision in tests in 0452b461bc

  6. Explore alternative orderings of group-by pathkeys during optimization.

  7. Generalize the common code of adding sort before processing of grouping

  8. Reorder actions in ProcArrayApplyRecoveryInfo()

  9. More documentation updates for incremental backup.

  10. Avoid useless ReplicationOriginExitCleanup locking