diff --git a/src/include/concurrency/transaction.h b/src/include/concurrency/transaction.h index 164650f4f..bc3b7dac2 100644 --- a/src/include/concurrency/transaction.h +++ b/src/include/concurrency/transaction.h @@ -137,9 +137,15 @@ class Transaction { write_set_[t].insert(rid); } + inline auto GetWriteSets() -> const std::unordered_map> & { return write_set_; } + inline auto AppendScanPredicate(table_oid_t t, const AbstractExpressionRef &predicate) { std::scoped_lock lck(latch_); - scan_predicates_.emplace_back(predicate); + scan_predicates_[t].emplace_back(predicate); + } + + inline auto GetScanPredicates() -> const std::unordered_map> & { + return scan_predicates_; } inline auto GetUndoLog(size_t log_id) -> UndoLog { @@ -180,7 +186,7 @@ class Transaction { /** stores the RID of write tuples */ std::unordered_map> write_set_; /** store all scan predicates */ - std::vector scan_predicates_; + std::unordered_map> scan_predicates_; // The below fields are set when a txn is created and will NEVER be changed.