Summary:
The BNL prefers minimal tuples from the outer subplan, because it
stores them and minimal tuples is a format optimized for storage.
So if the outer subplan is set to emit minimal tuples only, BNL
prepares itself to use the slots by reference. Otherwise BNL has
to initialize a slot to store minimal tuple copies from the outer
subplan into that slot.
However, there was a bug in the execution where BNL checked if each
individual tuple is minimal. Because of that bug, if outer subplan
produced a mix of tuples, slots with minimal tuples replaced the
initialized slot, and subsequent tuples were copied into those slots,
owned by the outer subplan, which interfered with the outer plan's
operation. The proper execution time criteria is to check if the slot
was initialized, and copy minimal tuple from the outer subplan
regardless.
Jira: DB-14901
Test Plan: ./yb_build.sh --java-test 'org.yb.pgsql.TestPgRegressJoin'
Reviewers: aagrawal, tnayak
Reviewed By: tnayak
Subscribers: yql
Tags: #jenkins-ready
Differential Revision: https://phorge.dev.yugabyte.com/D41659