On Wed, Feb 12, 2025 at 7:48 PM Tender Wang <tndrwang@gmail.com> wrote:
> Tender Wang <tndrwang@gmail.com> 于2025年2月12日周三 17:48写道:
> When we create join rel for (2,5), then wen enter try_partitionwise_join().
> In this func, we call build_child_join_sjinfo() to build SpecialJoinInfo for child.
> In build_child_join_sjinfo(), we use memcpy(), I think we should use copyObject().
> Otherwise, the parent_sjinfo will be freed, for example, after call free_child_join_sjinfo(),
> the parent_sjinfo min_lefthand looks like as below:
>
> (gdb) p *parent_sjinfo->min_lefthand
> $7 = {type = 3951489872, nwords = 21994, words = 0x55eaeb8696b0}
>
> The above bitmap is invalid, so trigger the Assert(bms_is_valid_set(a));
Nice catch! We should avoid freeing the members of child_sjinfo
unless they are translated copies of their counterparts in
parent_sjinfo.
Thanks
Richard