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

Function check_database

src/jrd/jrd.cpp:6728–6787  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6726
6727
6728static void check_database(thread_db* tdbb, bool async)
6729{
6730/**************************************
6731 *
6732 * c h e c k _ d a t a b a s e
6733 *
6734 **************************************
6735 *
6736 * Functional description
6737 * Check an attachment for validity.
6738 *
6739 **************************************/
6740 SET_TDBB(tdbb);
6741
6742 Database* const dbb = tdbb->getDatabase();
6743 Jrd::Attachment* const attachment = tdbb->getAttachment();
6744
6745 // Test for persistent errors
6746
6747 if (dbb->dbb_flags & DBB_bugcheck)
6748 {
6749 static const char string[] = "can't continue after bugcheck";
6750 status_exception::raise(Arg::Gds(isc_bug_check) << Arg::Str(string));
6751 }
6752
6753 if ((attachment->att_flags & ATT_shutdown) &&
6754 (attachment->att_purge_tid != Thread::getCurrentThreadId()) ||
6755 ((dbb->dbb_ast_flags & DBB_shutdown) &&
6756 ((dbb->dbb_ast_flags & DBB_shutdown_full) || !attachment->locksmith(tdbb, ACCESS_SHUTDOWN_DATABASE))))
6757 {
6758 if (dbb->dbb_ast_flags & DBB_shutdown)
6759 {
6760 const PathName& filename = attachment->att_filename;
6761 status_exception::raise(Arg::Gds(isc_shutdown) << Arg::Str(filename));
6762 }
6763
6764 Arg::Gds err(isc_att_shutdown);
6765
6766 if (attachment->getStable() && attachment->getStable()->getShutError())
6767 err << Arg::Gds(attachment->getStable()->getShutError());
6768
6769 err.raise();
6770 }
6771
6772 // No further checks for the async calls
6773
6774 if (async)
6775 return;
6776
6777 // Test for temporary errors
6778
6779 if ((attachment->att_flags & ATT_cancel_raise) &&
6780 !(attachment->att_flags & ATT_cancel_disable))
6781 {
6782 attachment->att_flags &= ~ATT_cancel_raise;
6783 status_exception::raise(Arg::Gds(isc_cancelled));
6784 }
6785

Callers 15

getInfoMethod · 0.85
freeEngineDataMethod · 0.85
internalCloseMethod · 0.85
internalCommitMethod · 0.85
commitRetainingMethod · 0.85
joinMethod · 0.85
enterDtcMethod · 0.85
compileRequestMethod · 0.85
createBlobMethod · 0.85
getSegmentMethod · 0.85
getSliceMethod · 0.85
openBlobMethod · 0.85

Calls 10

SET_TDBBFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
StrClass · 0.85
getDatabaseMethod · 0.80
getShutErrorMethod · 0.80
getAttachmentMethod · 0.45
locksmithMethod · 0.45
getStableMethod · 0.45
raiseMethod · 0.45

Tested by

no test coverage detected