core/mvcc: filter out seek results where is not same table_id

This commit is contained in:
Pere Diaz Bou
2025-10-06 13:29:10 +02:00
parent b9b9831d17
commit fc7e1639a0

View File

@@ -1322,7 +1322,7 @@ impl<Clock: LogicalClock> MvStore<Clock> {
let tx = self.txs.get(&tx_id).unwrap();
let tx = tx.value();
if lower_bound {
let res = if lower_bound {
self.rows
.lower_bound(bound)
.and_then(|entry| self.find_last_visible_version(tx, entry))
@@ -1330,7 +1330,19 @@ impl<Clock: LogicalClock> MvStore<Clock> {
self.rows
.upper_bound(bound)
.and_then(|entry| self.find_last_visible_version(tx, entry))
}
};
tracing::trace!(
"seek_rowid(bound={:?}, lower_bound={}, found={:?})",
bound,
lower_bound,
res
);
let table_id_expect = match bound {
Bound::Included(rowid) => rowid.table_id,
Bound::Excluded(rowid) => rowid.table_id,
Bound::Unbounded => unreachable!(),
};
res.filter(|&rowid| rowid.table_id == table_id_expect)
}
/// Begins an exclusive write transaction that prevents concurrent writes.