Problem
TableScanBuilder::UseRef() copies SnapshotRef::snapshot_id into an int32_t before looking up the snapshot and writing the scan context.
Snapshot IDs are stored as int64_t in SnapshotRef, TableMetadata::SnapshotById, and TableScanContext. A ref that points at a snapshot ID greater than INT32_MAX can be truncated, which can make branch/ref scans fail to find the snapshot or select the wrong ID.
Expected
UseRef() should preserve the full int64_t snapshot ID when resolving a ref.
Problem
TableScanBuilder::UseRef()copiesSnapshotRef::snapshot_idinto anint32_tbefore looking up the snapshot and writing the scan context.Snapshot IDs are stored as
int64_tinSnapshotRef,TableMetadata::SnapshotById, andTableScanContext. A ref that points at a snapshot ID greater thanINT32_MAXcan be truncated, which can make branch/ref scans fail to find the snapshot or select the wrong ID.Expected
UseRef()should preserve the fullint64_tsnapshot ID when resolving a ref.