Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/jrd/Database.h
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,7 @@ class Database : public pool_alloc<type_dbb>
USHORT dbb_dp_per_pp; // data pages per pointer page
USHORT dbb_max_records; // max record per data page
USHORT dbb_max_idx; // max number of indexes on a root page
ULONG dbb_rdb_pages; // cached number of first PP of RDB$PAGES relation, see hdr_PAGES

#ifdef SUPERSERVER_V2
USHORT dbb_prefetch_sequence; // sequence to pace frequency of prefetch requests
Expand Down
1 change: 1 addition & 0 deletions src/jrd/dpm.epp
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@ void DPM_create_relation_pages(thread_db* tdbb, jrd_rel* relation, RelationPages
header_page* header = (header_page*) CCH_FETCH(tdbb, &root_window, LCK_write, pag_header);
CCH_MARK(tdbb, &root_window);
header->hdr_PAGES = window.win_page.getPageNum();
dbb->dbb_rdb_pages = header->hdr_PAGES;

CCH_RELEASE(tdbb, &root_window);
}
Expand Down
11 changes: 11 additions & 0 deletions src/jrd/ini.epp
Original file line number Diff line number Diff line change
Expand Up @@ -1094,6 +1094,17 @@ void INI_init(thread_db* tdbb)
relation->rel_current_fmt = currentFormat;
relation->rel_current_format = (*relation->rel_formats)[currentFormat];
}

if (dbb->dbb_rdb_pages)
{
jrd_rel* relation = MET_relation(tdbb, 0);
RelationPages* relPages = relation->getBasePages();
fb_assert(!relPages->rel_pages);

vcl* vector = vcl::newVector(*relation->rel_pool, 1);
relPages->rel_pages = vector;
(*vector)[0] = dbb->dbb_rdb_pages;
}
}


Expand Down
3 changes: 1 addition & 2 deletions src/jrd/jrd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1820,9 +1820,9 @@ JAttachment* JProvider::internalAttach(CheckStatusWrapper* user_status, const ch

jAtt->getStable()->manualAsyncUnlock(attachment->att_flags);

PAG_header_init(tdbb);
INI_init(tdbb);
SHUT_init(tdbb);
PAG_header_init(tdbb);
PAG_init(tdbb);

if (options.dpb_set_page_buffers)
Expand Down Expand Up @@ -1881,7 +1881,6 @@ JAttachment* JProvider::internalAttach(CheckStatusWrapper* user_status, const ch
jAtt->getStable()->manualAsyncUnlock(attachment->att_flags);

INI_init(tdbb);
PAG_header(tdbb, true);
dbb->dbb_crypto_manager->attach(tdbb, attachment);
}

Expand Down
12 changes: 1 addition & 11 deletions src/jrd/pag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1122,17 +1122,6 @@ void PAG_header(thread_db* tdbb, bool info)
if (header->hdr_flags & hdr_SQL_dialect_3)
dbb->dbb_flags |= DBB_DB_SQL_dialect_3;

jrd_rel* relation = MET_relation(tdbb, 0);
RelationPages* relPages = relation->getBasePages();
if (!relPages->rel_pages)
{
// NS: There's no need to reassign first page for RDB$PAGES relation since
// current code cannot change its location after database creation.
vcl* vector = vcl::newVector(*relation->rel_pool, 1);
relPages->rel_pages = vector;
(*vector)[0] = header->hdr_PAGES;
}

dbb->dbb_next_transaction = next_transaction;

if (!info || dbb->dbb_oldest_transaction < oldest_transaction)
Expand Down Expand Up @@ -1334,6 +1323,7 @@ void PAG_header_init(thread_db* tdbb)

dbb->dbb_page_size = header->hdr_page_size;
dbb->dbb_page_buffers = header->hdr_page_buffers;
dbb->dbb_rdb_pages = header->hdr_PAGES;
}


Expand Down
Loading