Summary:
Commit b5b495dbd9b4ac6ec197705f89c795d9510c799e incorrectly translates
some logic, causing system and copartition secondary index scans to lose
the single-RPC optimization to embed a table and index scan together in
the same RPC. Fix the logic and add tests to cover the cases.
Jira: DB-16789
Test Plan:
On Almalinux 8:
./yb_build.sh fastdebug --gcc11 daemons initdb \
--cxx-test pgwrapper_pg_libpq-test \
--gtest_filter PgLibPqTest.Embedded\*
Close: #27294
Reviewers: sanketh
Reviewed By: sanketh
Subscribers: yql
Differential Revision: https://phorge.dev.yugabyte.com/D44085