Skip to content

Commit

Permalink
add abort/serializable tests
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh committed Nov 11, 2023
1 parent c3847bf commit c48fd14
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/include/concurrency/transaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,15 @@ class Transaction {
write_set_[t].insert(rid);
}

inline auto GetWriteSets() -> const std::unordered_map<table_oid_t, std::unordered_set<RID>> & { return write_set_; }

inline auto AppendScanPredicate(table_oid_t t, const AbstractExpressionRef &predicate) {
std::scoped_lock<std::mutex> lck(latch_);
scan_predicates_.emplace_back(predicate);
scan_predicates_[t].emplace_back(predicate);
}

inline auto GetScanPredicates() -> const std::unordered_map<table_oid_t, std::vector<AbstractExpressionRef>> & {
return scan_predicates_;
}

inline auto GetUndoLog(size_t log_id) -> UndoLog {
Expand Down Expand Up @@ -180,7 +186,7 @@ class Transaction {
/** stores the RID of write tuples */
std::unordered_map<table_oid_t, std::unordered_set<RID>> write_set_;
/** store all scan predicates */
std::vector<AbstractExpressionRef> scan_predicates_;
std::unordered_map<table_oid_t, std::vector<AbstractExpressionRef>> scan_predicates_;

// The below fields are set when a txn is created and will NEVER be changed.

Expand Down

0 comments on commit c48fd14

Please sign in to comment.