Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Refactor FunctionContext bootstrapping in DatabaseCatalog (#1187)
Browse files Browse the repository at this point in the history
Co-authored-by: Joseph Koshakow <koshy44@gmail.com>
  • Loading branch information
mbutrovich and jkosh44 authored Sep 16, 2020
1 parent b68a4a8 commit 1fca44d
Show file tree
Hide file tree
Showing 4 changed files with 182 additions and 323 deletions.
7 changes: 2 additions & 5 deletions src/catalog/catalog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,8 @@ bool Catalog::CreateDatabase(const common::ManagedPointer<transaction::Transacti
const bool bootstrap, const catalog::db_oid_t db_oid) {
// Instantiate the DatabaseCatalog
DatabaseCatalog *dbc = postgres::Builder::CreateDatabaseCatalog(catalog_block_store_, db_oid, garbage_collector_);
txn->RegisterAbortAction([=](transaction::DeferredActionManager *deferred_action_manager) {
dbc->TearDown(txn);
delete dbc;
});
bool success = Catalog::CreateDatabaseEntry(common::ManagedPointer(txn), db_oid, name, dbc);
txn->RegisterAbortAction([=](transaction::DeferredActionManager *deferred_action_manager) { delete dbc; });
const bool success = Catalog::CreateDatabaseEntry(common::ManagedPointer(txn), db_oid, name, dbc);
if (bootstrap) dbc->Bootstrap(txn); // Bootstrap the created database
return success;
}
Expand Down
Loading

0 comments on commit 1fca44d

Please sign in to comment.