Assert failure with MERGE into partitioned table with RLS

Started by Dean Rasheedalmost 4 years ago2 messageshackers
Jump to latest
#1Dean Rasheed
dean.a.rasheed@gmail.com

As part of the MERGE RETURNING patch I noticed a suspicious Assert()
in ExecInitPartitionInfo() that looked like it needed updating for
MERGE.

After more testing, I can confirm that this is indeed a pre-existing
bug, that can be triggered using MERGE into a partitioned table that
has RLS enabled (and hence non-empty withCheckOptionLists to
initialise).

So I think we need something like the attached.

Regards,
Dean

Attachments:

fix-merge-assert-failure.patchtext/x-patch; charset=US-ASCII; name=fix-merge-assert-failure.patchDownload+31-3
#2Dean Rasheed
dean.a.rasheed@gmail.com
In reply to: Dean Rasheed (#1)
Re: Assert failure with MERGE into partitioned table with RLS

On Mon, 20 Feb 2023 at 16:18, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:

As part of the MERGE RETURNING patch I noticed a suspicious Assert()
in ExecInitPartitionInfo() that looked like it needed updating for
MERGE.

After more testing, I can confirm that this is indeed a pre-existing
bug, that can be triggered using MERGE into a partitioned table that
has RLS enabled (and hence non-empty withCheckOptionLists to
initialise).

So I think we need something like the attached.

Pushed and back-patched.

Regards,
Dean