long[] childPKs = new long[] {11, 12, 21, 22};
for (int orderingMask = 0x0; orderingMask <= 0x7; orderingMask++) {
// Empty due to pid1
for (long childPK : childPKs) {
long parentPK = childPK / 10;
IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK + 1, parentPK + 1), SELECTOR);
IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK + 1, parentPK + 1), SELECTOR);
IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
Row[] expected = new Row[] {
};
compareRows(expected, cursor(plan, queryContext, queryBindings));
}
// Empty due to pid2
for (long childPK : childPKs) {
long parentPK = childPK / 10;
IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
Row[] expected = new Row[] {
};
compareRows(expected, cursor(plan, queryContext, queryBindings));
}
// Non-empty
for (long childPK : childPKs) {
long parentPK = childPK / 10;
IndexBound loBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK), SELECTOR);
IndexBound hiBound = new IndexBound(row(childPKRowType, childPK, parentPK, parentPK + 1), SELECTOR);
IndexKeyRange range = IndexKeyRange.bounded(childPKRowType, loBound, true, hiBound, true);
Operator plan = indexScan_Default(childPKRowType, range, ordering(orderingMask));
Row[] expected = new Row[] {
row(childRowType, childPK, parentPK, parentPK),
};