Skip to content

Commit

Permalink
address phoeb's review
Browse files Browse the repository at this point in the history
  • Loading branch information
Centril committed Dec 6, 2024
1 parent 46094e0 commit 11391fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/core/src/db/datastore/locking_tx_datastore/mut_tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,8 @@ impl MutTxId {
}

// Pacify the borrow checker.
// SAFETY: `ptr` came from `tx_table.insert` just now without any interleaving calls.
// SAFETY: `tx_row_ptr` came from `tx_table.insert` just now
// without any interleaving `&mut` calls that could invalidate the pointer.
let tx_row_ref = unsafe { tx_table.get_row_ref_unchecked(tx_blob_store, tx_row_ptr) };

// (2) The `tx_row_ref` did not violate a unique constraint *within* the `tx_table`,
Expand Down
4 changes: 3 additions & 1 deletion crates/table/src/btree_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ impl TypedIndex {
/// or may insert a nonsense value into the index.
/// Note, however, that it will not invoke undefined behavior.
///
/// Assumes that this is a unique constraint and returns `Ok(Some(existing_row))` if it's violated.
/// Assumes that this is a unique constraint
/// and returns `Ok(Some(existing_row))` if it's violated.
/// The index is not inserted to in that case.
fn insert_unique(&mut self, cols: &ColList, row_ref: RowRef<'_>) -> Result<Option<RowPointer>, InvalidFieldError> {
fn insert_at_type<T: Ord + ReadColumn>(
this: &mut Index<T>,
Expand Down

0 comments on commit 11391fe

Please sign in to comment.