mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 03:23:04 +01:00
Misc.
This commit is contained in:
parent
eedd10643b
commit
ae30b29011
@ -391,6 +391,7 @@ int jrd_rel::blocking_ast_gcLock(void* ast_object)
|
||||
SW - gc allowed, usual state
|
||||
PW - gc allowed to the one connection only
|
||||
****/
|
||||
|
||||
jrd_rel* relation = static_cast<jrd_rel*>(ast_object);
|
||||
|
||||
try
|
||||
@ -401,7 +402,7 @@ int jrd_rel::blocking_ast_gcLock(void* ast_object)
|
||||
AsyncContextHolder tdbb(dbb, FB_FUNCTION);
|
||||
|
||||
fb_assert(!(relation->rel_flags & REL_gc_lockneed));
|
||||
if (relation->rel_flags & REL_gc_lockneed) // work already done syncronously ?
|
||||
if (relation->rel_flags & REL_gc_lockneed) // work already done synchronously ?
|
||||
return 0;
|
||||
|
||||
relation->rel_flags |= REL_gc_blocking;
|
||||
|
@ -248,6 +248,7 @@ public:
|
||||
|
||||
static Lock* createLock(thread_db* tdbb, MemoryPool* pool, jrd_rel* relation, lck_t, bool);
|
||||
static int blocking_ast_gcLock(void*);
|
||||
|
||||
void downgradeGCLock(thread_db* tdbb);
|
||||
bool acquireGCLock(thread_db* tdbb, int wait);
|
||||
|
||||
@ -350,8 +351,8 @@ inline RelationPages* jrd_rel::getPages(thread_db* tdbb, TraNumber tran, bool al
|
||||
|
||||
/// class jrd_rel::GCShared
|
||||
|
||||
inline jrd_rel::GCShared::GCShared(thread_db* tdbb, jrd_rel* relation) :
|
||||
m_tdbb(tdbb),
|
||||
inline jrd_rel::GCShared::GCShared(thread_db* tdbb, jrd_rel* relation)
|
||||
: m_tdbb(tdbb),
|
||||
m_relation(relation),
|
||||
m_gcEnabled(false)
|
||||
{
|
||||
|
@ -50,8 +50,8 @@ void LCK_write_data(Jrd::thread_db*, Jrd::Lock*, SLONG);
|
||||
class AutoLock
|
||||
{
|
||||
public:
|
||||
explicit AutoLock(Jrd::thread_db* tdbb, Jrd::Lock* lck = NULL) :
|
||||
m_tdbb(tdbb),
|
||||
explicit AutoLock(Jrd::thread_db* tdbb, Jrd::Lock* lck = NULL)
|
||||
: m_tdbb(tdbb),
|
||||
m_lock(lck)
|
||||
{
|
||||
}
|
||||
|
@ -690,6 +690,7 @@ static int validate(Firebird::UtilSvc* svc)
|
||||
const Switches valSwitches(val_option_in_sw_table, FB_NELEM(val_option_in_sw_table), false, true);
|
||||
const char** argv = svc->argv.begin();
|
||||
const char* const* end = svc->argv.end();
|
||||
|
||||
for (++argv; argv < end; argv++)
|
||||
{
|
||||
if (!*argv)
|
||||
@ -972,9 +973,9 @@ void Validation::output(const char* format, ...)
|
||||
int ms;
|
||||
TimeStamp::getCurrentTimeStamp().decode(&now, &ms);
|
||||
|
||||
// s.printf("%04d-%02d-%02d %02d:%02d:%02d.%04d ",
|
||||
///s.printf("%04d-%02d-%02d %02d:%02d:%02d.%04d ",
|
||||
s.printf("%02d:%02d:%02d.%02d ",
|
||||
// now.tm_year + 1900, now.tm_mon + 1, now.tm_mday,
|
||||
///now.tm_year + 1900, now.tm_mon + 1, now.tm_mday,
|
||||
now.tm_hour, now.tm_min, now.tm_sec, ms / 100);
|
||||
vdr_service->outputVerbose(s.c_str());
|
||||
|
||||
@ -1581,16 +1582,20 @@ void Validation::walk_database()
|
||||
vdr_tab_incl->reset();
|
||||
if (!vdr_tab_incl->process((UCHAR*) relation->rel_name.c_str(), relation->rel_name.length()) ||
|
||||
!vdr_tab_incl->result())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (vdr_tab_excl)
|
||||
{
|
||||
vdr_tab_excl->reset();
|
||||
if (!vdr_tab_excl->process((UCHAR*) relation->rel_name.c_str(), relation->rel_name.length()) ||
|
||||
vdr_tab_excl->result())
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
string relName;
|
||||
relName.printf("Relation %d (%s)", relation->rel_id, relation->rel_name.c_str());
|
||||
@ -2708,7 +2713,7 @@ Validation::RTN Validation::walk_relation(jrd_rel* relation)
|
||||
}
|
||||
|
||||
WIN window(DB_PAGE_SPACE, -1);
|
||||
header_page* page = 0;
|
||||
header_page* page = NULL;
|
||||
fetch_page(false, (SLONG) HEADER_PAGE, pag_header, &window, &page);
|
||||
vdr_max_transaction = page->hdr_next_transaction;
|
||||
CCH_RELEASE(vdr_tdbb, &window);
|
||||
|
@ -862,7 +862,7 @@ bool VIO_chase_record_version(thread_db* tdbb, record_param* rpb,
|
||||
{ // scope
|
||||
jrd_rel::GCShared gcGuard(tdbb, rpb->rpb_relation);
|
||||
|
||||
if (attachment->att_flags & ATT_NO_CLEANUP || !gcGuard.gcEnabled() ||
|
||||
if ((attachment->att_flags & ATT_NO_CLEANUP) || !gcGuard.gcEnabled() ||
|
||||
(rpb->rpb_flags & (rpb_chained | rpb_gc_active)))
|
||||
{
|
||||
if (rpb->rpb_b_page == 0)
|
||||
@ -1939,7 +1939,7 @@ bool VIO_garbage_collect(thread_db* tdbb, record_param* rpb, const jrd_tra* tran
|
||||
|
||||
jrd_rel::GCShared gcGuard(tdbb, rpb->rpb_relation);
|
||||
|
||||
if (attachment->att_flags & ATT_no_cleanup || !gcGuard.gcEnabled())
|
||||
if ((attachment->att_flags & ATT_no_cleanup) || !gcGuard.gcEnabled())
|
||||
return true;
|
||||
|
||||
const TraNumber oldest_snapshot = rpb->rpb_relation->isTemporary() ?
|
||||
@ -3643,6 +3643,7 @@ bool VIO_sweep(thread_db* tdbb, jrd_tra* transaction, TraceSweepEvent* traceSwee
|
||||
|
||||
ERR_punt();
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user