1
1
2
+ #include < include/catalog/catalog.h>
2
3
#include " index/index_factory.h"
3
4
4
5
#include " catalog/index_catalog.h"
5
6
#include " catalog/column_catalog.h"
6
7
#include " catalog/table_catalog.h"
7
8
#include " catalog/database_catalog.h"
9
+ #include " catalog/system_catalogs.h"
8
10
#include " concurrency/transaction_manager_factory.h"
9
11
#include " catalog/catalog_defaults.h"
10
12
#include " type/ephemeral_pool.h"
@@ -322,7 +324,7 @@ void WalRecovery::ReplaySingleTxn(txn_id_t txn_id){
322
324
InstallCatalogTuple (record_type, tuple.get (), table, commit_id, location);
323
325
324
326
// update table oid to prevent oid reuse after recovery
325
- catalog::TableCatalog ::GetInstance ()->GetNextOid (); // TODO(graghura): This is a hack, rewrite !!!
327
+ catalog::Catalog ::GetInstance ()->GetSystemCatalogs (CATALOG_DATABASE_OID)-> GetTableCatalog ()-> GetNextOid ();
326
328
tuple_table_create = std::move (tuple);
327
329
pending_table_create = true ;
328
330
@@ -334,7 +336,7 @@ void WalRecovery::ReplaySingleTxn(txn_id_t txn_id){
334
336
InstallCatalogTuple (record_type, tuple.get (), table, commit_id, location);
335
337
336
338
// update column oid to prevent oid reuse after recovery
337
- catalog::ColumnCatalog ::GetInstance ()->GetNextOid (); // TODO(graghura): This is a hack, rewrite !!!
339
+ catalog::Catalog ::GetInstance ()->GetSystemCatalogs (CATALOG_DATABASE_OID)-> GetColumnCatalog ()-> GetNextOid ();
338
340
339
341
bool is_inline = true ;
340
342
@@ -361,7 +363,7 @@ void WalRecovery::ReplaySingleTxn(txn_id_t txn_id){
361
363
} else if (table_id == INDEX_CATALOG_OID) {
362
364
LOG_INFO (" REPLAYING INSERT TO PG_INDEX" );
363
365
indexes.push_back (std::move (tuple));
364
- catalog::IndexCatalog ::GetInstance ()->GetNextOid (); // TODO(graghura): This is a hack, rewrite !!!
366
+ catalog::Catalog ::GetInstance ()->GetSystemCatalogs (CATALOG_DATABASE_OID)-> GetIndexCatalog ()-> GetNextOid ();
365
367
}
366
368
} else {
367
369
@@ -469,7 +471,8 @@ void WalRecovery::ReplaySingleTxn(txn_id_t txn_id){
469
471
auto txn = concurrency::TransactionManagerFactory::GetInstance ().BeginTransaction (
470
472
IsolationLevelType::SERIALIZABLE);
471
473
472
- auto table_catalog = catalog::TableCatalog::GetInstance ();
474
+ auto table_catalog = catalog::Catalog::GetInstance ()->
475
+ GetSystemCatalogs (CATALOG_DATABASE_OID)->GetTableCatalog ();
473
476
auto table_object = table_catalog->GetTableObject (tup->GetValue (2 ).GetAs <oid_t >(), txn);
474
477
auto database_oid = table_object->GetDatabaseOid ();
475
478
auto table = storage::StorageManager::GetInstance ()->GetTableWithOid (
0 commit comments