pub(crate) fn cmp_pk_unsigned_aware<'a>(
lhs: impl Iterator<Item = DatumRef<'a>>,
rhs: impl Iterator<Item = DatumRef<'a>>,
pk_order: &[OrderType],
pk_needs_unsigned_i64_compare: &[bool],
) -> OrderingExpand description
Compare two primary-key rows column by column, recovering the upstream unsigned order
for BIGINT UNSIGNED pk columns.
pk_needs_unsigned_i64_compare[i] is true only for upstream BIGINT UNSIGNED. Frontend
up-casts narrower unsigned integers so they stay non-negative in RisingWave, and unsigned
float/double/decimal types must keep their native comparison semantics. Only BIGINT UNSIGNED
can overflow into a negative i64, so we reinterpret both sides as u64 to restore upstream
MySQL ordering. The ScalarRefImpl::Int64 match below is a defensive guard for that contract.