validation.cpp (Firebird-3.0.2.32703-0.tar.bz2) | : | validation.cpp (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 728 | skipping to change at line 728 | |||
} | } | |||
PathName expandedFilename; | PathName expandedFilename; | |||
if (expandDatabaseName(dbName, expandedFilename, NULL)) | if (expandDatabaseName(dbName, expandedFilename, NULL)) | |||
expandedFilename = dbName; | expandedFilename = dbName; | |||
if (dbName != expandedFilename) | if (dbName != expandedFilename) | |||
dpb.insertPath(isc_dpb_org_filename, dbName); | dpb.insertPath(isc_dpb_org_filename, dbName); | |||
FbLocalStatus status; | FbLocalStatus status; | |||
RefPtr<JProvider> jProv(JProvider::getInstance()); | AutoPlugin<JProvider> jProv(JProvider::getInstance()); | |||
RefPtr<JAttachment> jAtt; | RefPtr<JAttachment> jAtt; | |||
jAtt.assignRefNoIncr(jProv->attachDatabase(&status, expandedFilename.c_st r(), dpb.getBufferLength(), dpb.getBuffer())); | jAtt.assignRefNoIncr(jProv->attachDatabase(&status, expandedFilename.c_st r(), dpb.getBufferLength(), dpb.getBuffer())); | |||
if (status->getState() & IStatus::STATE_ERRORS) | if (status->getState() & IStatus::STATE_ERRORS) | |||
{ | { | |||
svc->setServiceStatus(status->getErrors()); | svc->setServiceStatus(status->getErrors()); | |||
return FB_FAILURE; | return FB_FAILURE; | |||
} | } | |||
Attachment* att = jAtt->getHandle(); | Attachment* att = jAtt->getHandle(); | |||
skipping to change at line 817 | skipping to change at line 817 | |||
{false, fb_info_bpage_warns, "Blob %" SQUADFORMAT" appears inconsisten t"}, // 5 | {false, fb_info_bpage_warns, "Blob %" SQUADFORMAT" appears inconsisten t"}, // 5 | |||
{true, isc_info_bpage_errors, "Blob %" SQUADFORMAT" is corrupt"}, | {true, isc_info_bpage_errors, "Blob %" SQUADFORMAT" is corrupt"}, | |||
{true, isc_info_bpage_errors, "Blob %" SQUADFORMAT" is truncated"}, | {true, isc_info_bpage_errors, "Blob %" SQUADFORMAT" is truncated"}, | |||
{true, isc_info_record_errors, "Chain for record %" SQUADFORMAT" is brok en"}, | {true, isc_info_record_errors, "Chain for record %" SQUADFORMAT" is brok en"}, | |||
{true, isc_info_dpage_errors, "Data page %" ULONGFORMAT" {sequence %" U LONGFORMAT"} is confused"}, | {true, isc_info_dpage_errors, "Data page %" ULONGFORMAT" {sequence %" U LONGFORMAT"} is confused"}, | |||
{true, isc_info_dpage_errors, "Data page %" ULONGFORMAT" {sequence %" U LONGFORMAT"}, line %" ULONGFORMAT" is bad"}, // 10 | {true, isc_info_dpage_errors, "Data page %" ULONGFORMAT" {sequence %" U LONGFORMAT"}, line %" ULONGFORMAT" is bad"}, // 10 | |||
{true, isc_info_ipage_errors, "Index %d is corrupt on page %" ULONGFORM AT" level %d at offset %" ULONGFORMAT". File: %s, line: %d\n\t"}, | {true, isc_info_ipage_errors, "Index %d is corrupt on page %" ULONGFORM AT" level %d at offset %" ULONGFORMAT". File: %s, line: %d\n\t"}, | |||
{true, isc_info_ppage_errors, "Pointer page {sequence %" ULONGFORMAT"} lost"}, | {true, isc_info_ppage_errors, "Pointer page {sequence %" ULONGFORMAT"} lost"}, | |||
{true, isc_info_ppage_errors, "Pointer page %" ULONGFORMAT" {sequence % " ULONGFORMAT"} inconsistent"}, | {true, isc_info_ppage_errors, "Pointer page %" ULONGFORMAT" {sequence % " ULONGFORMAT"} inconsistent"}, | |||
{true, isc_info_record_errors, "Record %" SQUADFORMAT" is marked as dama ged"}, | {true, isc_info_record_errors, "Record %" SQUADFORMAT" is marked as dama ged"}, | |||
{true, isc_info_record_errors, "Record %" SQUADFORMAT" has bad transacti on %" ULONGFORMAT}, // 15 | {true, isc_info_record_errors, "Record %" SQUADFORMAT" has bad transacti on %" SQUADFORMAT}, // 15 | |||
{true, isc_info_record_errors, "Fragmented record %" SQUADFORMAT" is cor rupt"}, | {true, isc_info_record_errors, "Fragmented record %" SQUADFORMAT" is cor rupt"}, | |||
{true, isc_info_record_errors, "Record %" SQUADFORMAT" is wrong length"} , | {true, isc_info_record_errors, "Record %" SQUADFORMAT" is wrong length"} , | |||
{true, isc_info_ipage_errors, "Missing index root page"}, | {true, isc_info_ipage_errors, "Missing index root page"}, | |||
{true, isc_info_tpage_errors, "Transaction inventory pages lost"}, | {true, isc_info_tpage_errors, "Transaction inventory pages lost"}, | |||
{true, isc_info_tpage_errors, "Transaction inventory page lost, sequenc e %" ULONGFORMAT}, // 20 | {true, isc_info_tpage_errors, "Transaction inventory page lost, sequenc e %" ULONGFORMAT}, // 20 | |||
{true, isc_info_tpage_errors, "Transaction inventory pages confused, se quence %" ULONGFORMAT}, | {true, isc_info_tpage_errors, "Transaction inventory pages confused, se quence %" ULONGFORMAT}, | |||
{false, fb_info_record_warns, "Relation has %" UQUADFORMAT" orphan back versions {%" UQUADFORMAT" in use}"}, | {false, fb_info_record_warns, "Relation has %" UQUADFORMAT" orphan back versions {%" UQUADFORMAT" in use}"}, | |||
{true, isc_info_ipage_errors, "Index %d is corrupt {missing entries for record %" SQUADFORMAT"}"}, | {true, isc_info_ipage_errors, "Index %d is corrupt {missing entries for record %" SQUADFORMAT"}"}, | |||
{false, fb_info_ipage_warns, "Index %d has orphan child page at page % " ULONGFORMAT}, | {false, fb_info_ipage_warns, "Index %d has orphan child page at page % " ULONGFORMAT}, | |||
{true, isc_info_ipage_errors, "Index %d has a circular reference at pag e %" ULONGFORMAT}, // 25 | {true, isc_info_ipage_errors, "Index %d has a circular reference at pag e %" ULONGFORMAT}, // 25 | |||
skipping to change at line 1359 | skipping to change at line 1359 | |||
{ | { | |||
// Page is potentially an orphan - but do n't declare it as such | // Page is potentially an orphan - but do n't declare it as such | |||
// unless we think we walked all pages | // unless we think we walked all pages | |||
corrupt(VAL_PAG_ORPHAN, 0, number); | corrupt(VAL_PAG_ORPHAN, 0, number); | |||
if (vdr_flags & VDR_update) | if (vdr_flags & VDR_update) | |||
{ | { | |||
CCH_MARK(vdr_tdbb, &window); | CCH_MARK(vdr_tdbb, &window); | |||
p[-1] |= 1 << (number & 7); | p[-1] |= 1 << (number & 7); | |||
vdr_fixed++; | vdr_fixed++; | |||
const ULONG bit = number - sequen | ||||
ce * pageSpaceMgr.pagesPerPIP; | ||||
if (page->pip_min > bit) | ||||
page->pip_min = bit; | ||||
if (p[-1] == 0xFF && page->pip_ex | ||||
tent > bit) | ||||
page->pip_extent = bit & | ||||
((ULONG)~7); | ||||
} | } | |||
DEBUG; | DEBUG; | |||
} | } | |||
} | } | |||
} | } | |||
const UCHAR test_byte = p[-1]; | const UCHAR test_byte = p[-1]; | |||
release_page(&window); | release_page(&window); | |||
if (test_byte & 0x80) | if (test_byte & 0x80) | |||
break; | break; | |||
} | } | |||
skipping to change at line 1600 | skipping to change at line 1607 | |||
"walk_database: %s\nODS: %d.%d\nPage size %d\n ", | "walk_database: %s\nODS: %d.%d\nPage size %d\n ", | |||
dbb->dbb_filename.c_str(), dbb->dbb_ods_versio n, dbb->dbb_minor_version, | dbb->dbb_filename.c_str(), dbb->dbb_ods_versio n, dbb->dbb_minor_version, | |||
dbb->dbb_page_size); | dbb->dbb_page_size); | |||
} | } | |||
#endif | #endif | |||
DPM_scan_pages(vdr_tdbb); | DPM_scan_pages(vdr_tdbb); | |||
WIN window(DB_PAGE_SPACE, -1); | WIN window(DB_PAGE_SPACE, -1); | |||
header_page* page = 0; | header_page* page = 0; | |||
fetch_page(true, HEADER_PAGE, pag_header, &window, &page); | fetch_page(true, HEADER_PAGE, pag_header, &window, &page); | |||
vdr_max_transaction = page->hdr_next_transaction; | TraNumber next = vdr_max_transaction = Ods::getNT(page); | |||
if (vdr_flags & VDR_online) { | if (vdr_flags & VDR_online) { | |||
release_page(&window); | release_page(&window); | |||
} | } | |||
if (!(vdr_flags & VDR_partial)) | if (!(vdr_flags & VDR_partial)) | |||
{ | { | |||
walk_header(page->hdr_next_page); | walk_header(page->hdr_next_page); | |||
walk_pip(); | walk_pip(); | |||
walk_scns(); | walk_scns(); | |||
walk_tip(page->hdr_next_transaction); | walk_tip(next); | |||
walk_generators(); | walk_generators(); | |||
} | } | |||
vec<jrd_rel*>* vector; | vec<jrd_rel*>* vector; | |||
for (USHORT i = 0; (vector = attachment->att_relations) && i < vector->co unt(); i++) | for (USHORT i = 0; (vector = attachment->att_relations) && i < vector->co unt(); i++) | |||
{ | { | |||
#ifdef DEBUG_VAL_VERBOSE | #ifdef DEBUG_VAL_VERBOSE | |||
if (i > dbb->dbb_max_sys_rel) // Why not system flag instead? | if (i > dbb->dbb_max_sys_rel) // Why not system flag instead? | |||
VAL_debug_level = 2; | VAL_debug_level = 2; | |||
#endif | #endif | |||
skipping to change at line 2693 | skipping to change at line 2700 | |||
const rhdf* fragment = (rhdf*) header; | const rhdf* fragment = (rhdf*) header; | |||
const char* p; | const char* p; | |||
const char* end; | const char* end; | |||
if (header->rhd_flags & rhd_incomplete) | if (header->rhd_flags & rhd_incomplete) | |||
{ | { | |||
p = (SCHAR*) fragment->rhdf_data; | p = (SCHAR*) fragment->rhdf_data; | |||
end = p + length - offsetof(rhdf, rhdf_data[0]); | end = p + length - offsetof(rhdf, rhdf_data[0]); | |||
} | } | |||
else if (header->rhd_flags & rhd_long_tranum) | ||||
{ | ||||
p = (SCHAR*) ((rhde*)header)->rhde_data; | ||||
end = p + length - offsetof(rhde, rhde_data[0]); | ||||
} | ||||
else | else | |||
{ | { | |||
p = (SCHAR*) header->rhd_data; | p = (SCHAR*) header->rhd_data; | |||
end = p + length - offsetof(rhd, rhd_data[0]); | end = p + length - offsetof(rhd, rhd_data[0]); | |||
} | } | |||
ULONG record_length = 0; | ULONG record_length = 0; | |||
while (p < end) | while (p < end) | |||
{ | { | |||
skipping to change at line 2750 | skipping to change at line 2762 | |||
{ | { | |||
fprintf(stdout, "fragment: pg %d/%d ", page_number, line_ number); | fprintf(stdout, "fragment: pg %d/%d ", page_number, line_ number); | |||
print_rhd(line->dpg_length, (rhd*) fragment); | print_rhd(line->dpg_length, (rhd*) fragment); | |||
} | } | |||
#endif | #endif | |||
if (fragment->rhdf_flags & rhd_incomplete) | if (fragment->rhdf_flags & rhd_incomplete) | |||
{ | { | |||
p = (SCHAR*) fragment->rhdf_data; | p = (SCHAR*) fragment->rhdf_data; | |||
end = p + line->dpg_length - offsetof(rhdf, rhdf_data[0]) ; | end = p + line->dpg_length - offsetof(rhdf, rhdf_data[0]) ; | |||
} | } | |||
else if (fragment->rhdf_flags & rhd_long_tranum) | ||||
{ | ||||
p = (SCHAR*) ((rhde*)fragment)->rhde_data; | ||||
end = p + line->dpg_length - offsetof(rhde, rhde_data[0]) | ||||
; | ||||
} | ||||
else | else | |||
{ | { | |||
p = (SCHAR*) ((rhd*) fragment)->rhd_data; | p = (SCHAR*) ((rhd*) fragment)->rhd_data; | |||
end = p + line->dpg_length - offsetof(rhd, rhd_data[0]); | end = p + line->dpg_length - offsetof(rhd, rhd_data[0]); | |||
} | } | |||
while (p < end) | while (p < end) | |||
{ | { | |||
const signed char c = *p++; | const signed char c = *p++; | |||
if (c >= 0) | if (c >= 0) | |||
{ | { | |||
skipping to change at line 2990 | skipping to change at line 3007 | |||
if (!lckGC.acquire(vdr_lock_tout)) | if (!lckGC.acquire(vdr_lock_tout)) | |||
{ | { | |||
output("Acquire garbage collection lock failed\n"); | output("Acquire garbage collection lock failed\n"); | |||
vdr_errors++; | vdr_errors++; | |||
return rtn_ok; | return rtn_ok; | |||
} | } | |||
WIN window(DB_PAGE_SPACE, -1); | WIN window(DB_PAGE_SPACE, -1); | |||
header_page* page = NULL; | header_page* page = NULL; | |||
fetch_page(false, (SLONG) HEADER_PAGE, pag_header, &window, &page ); | fetch_page(false, (SLONG) HEADER_PAGE, pag_header, &window, &page ); | |||
vdr_max_transaction = page->hdr_next_transaction; | vdr_max_transaction = Ods::getNT(page); | |||
release_page(&window); | release_page(&window); | |||
} | } | |||
// Walk pointer and selected data pages associated with relation | // Walk pointer and selected data pages associated with relation | |||
vdr_rel_backversion_counter = 0; | vdr_rel_backversion_counter = 0; | |||
PageBitmap::reset(vdr_backversion_pages); | PageBitmap::reset(vdr_backversion_pages); | |||
vdr_rel_chain_counter = 0; | vdr_rel_chain_counter = 0; | |||
PageBitmap::reset(vdr_chain_pages); | PageBitmap::reset(vdr_chain_pages); | |||
RecordBitmap::reset(vdr_rel_records); | RecordBitmap::reset(vdr_rel_records); | |||
End of changes. 8 change blocks. | ||||
5 lines changed or deleted | 26 lines changed or added |