Summary:
YbBindSearchArray's YbIsRowHeader case code has a section that marks
is_column_bound on the columns involved in this row array comparison.
There are a number of bugs related to this:
- The moment it finds a column is already bound, it immediately returns,
but it never resets the mutations to is_column_bound it made up to
that point. This could theoretically lead to less conditions being
pushed down to DocDB. Fix by only mutating is_column_bound after
making sure all columns are bindable.
- In case we return immediately from finding a column bound, there is no
code setting ybScan->all_ordinary_keys_bound to false. This could
theoretically lead to rechecks not being done when they should be,
causing results not matching conditions to retrieved. Fix by setting
this to false.
Further, the logic
is_column_bound[idx] |= is_bound;
is confusing, so refactor it to only set is_column_bound inside
YbBindSearchArray.
There is no known case where this can cause user-facing issues, but this
issue could be easier to hit after #29032.
Jira: DB-18799
Test Plan:
Jenkins
Close: #29042
Reviewers: mtakahara, aagrawal
Reviewed By: mtakahara
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D47683