src/yb/docdb/doc_pgsql_scanspec.cc
// Return inclusive lower/upper range doc key considering the start_doc_key.
Return inclusive lower/upper range doc key considering the start_doc_key.
Return inclusive lower / upper range doc key considering the start_doc_key .
Result<KeyBytes> DocPgsqlScanSpec::Bound(const bool lower_bound) const {
  if (start_doc_key_.empty()) {
    return lower_bound ? lower_doc_key_ : upper_doc_key_;
  }
  if (start_doc_key_ < lower_doc_key_ || start_doc_key_ > upper_doc_key_) {
    return STATUS_FORMAT(Corruption, "Invalid start_doc_key: $0. Range: $1, $2",
                         start_doc_key_, lower_doc_key_, upper_doc_key_);
  }
  if (is_forward_scan_) {
    return lower_bound ? start_doc_key_ : upper_doc_key_;
  }
  if (lower_bound) {
    return lower_doc_key_;
  }
  KeyBytes result = start_doc_key_;
  result.AppendValueTypeBeforeGroupEnd(ValueType::kHighest);
  return result;
}
Result < KeyBytes > DocPgsqlScanSpec :: Bound ( const bool lower_bound ) const { if ( start_doc_key_ . empty ( ) ) { return lower_bound ? lower_doc_key_ : upper_doc_key_ ; } if ( start_doc_key_ < lower_doc_key_ || start_doc_key_ > upper_doc_key_ ) { return STATUS_FORMAT ( Corruption , " " , start_doc_key_ , lower_doc_key_ , upper_doc_key_ ) ; } if ( is_forward_scan_ ) { return lower_bound ? start_doc_key_ : upper_doc_key_ ; } if ( lower_bound ) { return lower_doc_key_ ; } KeyBytes result = start_doc_key_ ; result . AppendValueTypeBeforeGroupEnd ( ValueType :: kHighest ) ; return result ; }
Return inclusive lower/upper range doc key considering the start_doc_key.
Return inclusive lower / upper range doc key considering the start_doc_key .
// When paging state is present, start_doc_key_ should have been provided, and the scan starting // point should be start_doc_key_ instead of the initial bounds. // Paging state + forward scan. // Paging state + reverse scan. // If using start_doc_key_ as upper bound append +inf as extra component to ensure it includes // the target start_doc_key itself (dockey + suffix < dockey + kHighest). // For lower bound, this is true already, because dockey + suffix is > dockey.