MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / PAG_format_header

Function PAG_format_header

src/jrd/pag.cpp:935–975  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

933
934
935void PAG_format_header(thread_db* tdbb)
936{
937/**************************************
938 *
939 * P A G _ f o r m a t _ h e a d e r
940 *
941 **************************************
942 *
943 * Functional description
944 * Create the header page for a new file.
945 *
946 **************************************/
947 SET_TDBB(tdbb);
948 Database* const dbb = tdbb->getDatabase();
949 CHECK_DBB(dbb);
950
951 // Initialize header page
952
953 WIN window(HEADER_PAGE_NUMBER);
954 header_page* header = (header_page*) CCH_fake(tdbb, &window, 1);
955 header->hdr_header.pag_scn = 0;
956 *(ISC_TIMESTAMP*) header->hdr_creation_date = TimeZoneUtil::getCurrentGmtTimeStamp().utc_timestamp;
957 // should we include milliseconds or not?
958 //TimeStamp::round_time(header->hdr_creation_date->timestamp_time, 0);
959 header->hdr_header.pag_type = pag_header;
960 header->hdr_page_size = dbb->dbb_page_size;
961 header->hdr_ods_version = ODS_VERSION | ODS_FIREBIRD_FLAG;
962 DbImplementation::current.store(header);
963 header->hdr_ods_minor = ODS_CURRENT;
964 header->hdr_oldest_transaction = 1;
965 header->hdr_end = HDR_SIZE;
966 header->hdr_data[0] = HDR_end;
967
968 if (dbb->dbb_flags & DBB_DB_SQL_dialect_3)
969 header->hdr_flags |= hdr_SQL_dialect_3;
970
971 dbb->dbb_ods_version = header->hdr_ods_version & ~ODS_FIREBIRD_FLAG;
972 dbb->dbb_minor_version = header->hdr_ods_minor;
973
974 CCH_RELEASE(tdbb, &window);
975}
976
977
978void PAG_format_pip(thread_db* tdbb, PageSpace& pageSpace)

Callers 1

createDatabaseMethod · 0.85

Calls 6

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
CCH_fakeFunction · 0.85
CCH_RELEASEFunction · 0.85
getDatabaseMethod · 0.80
storeMethod · 0.45

Tested by

no test coverage detected