Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Chi <[email protected]>
  • Loading branch information
skyzh committed Oct 25, 2023
1 parent b117b6e commit 7b1b2c8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions src/common/bustub_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,11 @@ auto BustubInstance::ExecuteSql(const std::string &sql, ResultWriter &writer,
try {
auto result = ExecuteSqlTxn(sql, writer, txn, std::move(check_options));
txn_manager_->Commit(txn);
delete txn;
return result;
} catch (bustub::Exception &ex) {
txn_manager_->Abort(txn);
delete txn;
throw ex;
}
}
Expand Down Expand Up @@ -345,6 +347,7 @@ void BustubInstance::GenerateTestTable() {
l.unlock();

txn_manager_->Commit(txn);
delete txn;
}

/**
Expand All @@ -363,6 +366,7 @@ void BustubInstance::GenerateMockTable() {
l.unlock();

txn_manager_->Commit(txn);
delete txn;
}

BustubInstance::~BustubInstance() {
Expand Down
2 changes: 1 addition & 1 deletion test/table/tuple_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ TEST(TupleTest, DISABLED_TableHeapTest) {

std::vector<RID> rid_v;
for (int i = 0; i < 5000; ++i) {
auto rid = table->InsertTuple(TupleMeta{INVALID_TXN_ID, INVALID_TXN_ID, false}, tuple);
auto rid = table->InsertTuple(TupleMeta{0, false}, tuple);
rid_v.push_back(*rid);
}

Expand Down

0 comments on commit 7b1b2c8

Please sign in to comment.