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

Function PAG_delete_clump_entry

src/jrd/pag.cpp:888–932  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

886
887
888bool PAG_delete_clump_entry(thread_db* tdbb, USHORT type)
889{
890/***********************************************
891 *
892 * P A G _ d e l e t e _ c l u m p _ e n t r y
893 *
894 ***********************************************
895 *
896 * Functional description
897 * Gets rid on the entry 'type' from page.
898 *
899 **************************************/
900 SET_TDBB(tdbb);
901 Database* dbb = tdbb->getDatabase();
902 CHECK_DBB(dbb);
903
904 err_post_if_database_is_readonly(dbb);
905
906 WIN window(DB_PAGE_SPACE, HEADER_PAGE);
907
908 pag* page = CCH_FETCH(tdbb, &window, LCK_write, pag_header);
909
910 UCHAR* entry_p;
911 const UCHAR* clump_end;
912 if (!find_type(tdbb, &window, &page, LCK_write, type, &entry_p, &clump_end))
913 {
914 CCH_RELEASE(tdbb, &window);
915 return false;
916 }
917 CCH_MARK(tdbb, &window);
918
919 header_page* header = (header_page*) page;
920 USHORT* end_addr = &header->hdr_end;
921
922 *end_addr -= (2u + entry_p[1]);
923
924 const UCHAR* r = entry_p + 2 + entry_p[1];
925 USHORT shift = clump_end - r + 1;
926 if (shift)
927 memmove(entry_p, r, shift);
928
929 CCH_RELEASE(tdbb, &window);
930
931 return true;
932}
933
934
935void PAG_format_header(thread_db* tdbb)

Callers 1

setDifferenceMethod · 0.85

Calls 8

SET_TDBBFunction · 0.85
CHECK_DBBFunction · 0.85
CCH_FETCHFunction · 0.85
find_typeFunction · 0.85
CCH_RELEASEFunction · 0.85
CCH_MARKFunction · 0.85
getDatabaseMethod · 0.80

Tested by

no test coverage detected