"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/jrd/dfw.epp" between
Firebird-3.0.2.32703-0.tar.bz2 and Firebird-3.0.4.33054-0.tar.bz2

About: Firebird is a relational database offering many ANSI SQL standard features.

dfw.epp  (Firebird-3.0.2.32703-0.tar.bz2):dfw.epp  (Firebird-3.0.4.33054-0.tar.bz2)
skipping to change at line 3518 skipping to change at line 3518
SET_TDBB(tdbb); SET_TDBB(tdbb);
Jrd::Attachment* attachment = tdbb->getAttachment(); Jrd::Attachment* attachment = tdbb->getAttachment();
Database* dbb = tdbb->getDatabase(); Database* dbb = tdbb->getDatabase();
const USHORT local_min_relation_id = USER_DEF_REL_INIT_ID; const USHORT local_min_relation_id = USER_DEF_REL_INIT_ID;
switch (phase) switch (phase)
{ {
case 0: case 0:
// We need to cleanup RDB$PAGES and pages if they were added at p
hase 3.
request.reset(tdbb, irq_c_relation3, IRQ_REQUESTS);
FOR(REQUEST_HANDLE request)
X IN RDB$RELATIONS WITH
X.RDB$RELATION_NAME EQ work->dfw_name.c_str() AND
X.RDB$RELATION_ID NOT MISSING
{
rel_id = X.RDB$RELATION_ID;
if ( (relation = MET_lookup_relation_id(tdbb, rel_id, fal
se)) )
{
RelationPages* const relPages = relation->getBase
Pages();
if (relPages->rel_index_root)
IDX_delete_indices(tdbb, relation, relPages);
if (relPages->rel_pages)
DPM_delete_relation(tdbb, relation);
// Mark relation in the cache as dropped
relation->rel_flags |= REL_deleted;
}
}
END_FOR
if (work->dfw_lock) if (work->dfw_lock)
{ {
LCK_release(tdbb, work->dfw_lock); LCK_release(tdbb, work->dfw_lock);
delete work->dfw_lock; delete work->dfw_lock;
work->dfw_lock = NULL; work->dfw_lock = NULL;
} }
break; break;
case 1: case 1:
case 2: case 2:
skipping to change at line 3562 skipping to change at line 3587
{ {
blob_id = Y.RDB$VIEW_BLR; blob_id = Y.RDB$VIEW_BLR;
external_flag = Y.RDB$EXTERNAL_FILE[0]; external_flag = Y.RDB$EXTERNAL_FILE[0];
MODIFY X USING MODIFY X USING
rel_id = X.RDB$RELATION_ID; rel_id = X.RDB$RELATION_ID;
if (rel_id < local_min_relation_id || rel_id > MA X_RELATION_ID) if (rel_id < local_min_relation_id || rel_id > MA X_RELATION_ID)
rel_id = X.RDB$RELATION_ID = local_min_re lation_id; rel_id = X.RDB$RELATION_ID = local_min_re lation_id;
while ( (relation = MET_lookup_relation_id(tdbb, // Roman Simakov: We need to return deleted relat
rel_id++, false)) ) ions to skip them.
// This maybe result of cleanup failure after pha
se 3.
while ( (relation = MET_lookup_relation_id(tdbb,
rel_id++, true)) )
{ {
if (rel_id < local_min_relation_id || rel _id > MAX_RELATION_ID) if (rel_id < local_min_relation_id || rel _id > MAX_RELATION_ID)
rel_id = local_min_relation_id; rel_id = local_min_relation_id;
if (rel_id == X.RDB$RELATION_ID) if (rel_id == X.RDB$RELATION_ID)
{ {
ERR_post(Arg::Gds(isc_no_meta_upd ate) << ERR_post(Arg::Gds(isc_no_meta_upd ate) <<
Arg::Gds(isc_tab le_name) << Arg::Str(work->dfw_name) << Arg::Gds(isc_tab le_name) << Arg::Str(work->dfw_name) <<
Arg::Gds(isc_imp _exc)); Arg::Gds(isc_imp _exc));
} }
skipping to change at line 3684 skipping to change at line 3711
if (!work->findArg(dfw_arg_rel_name)) if (!work->findArg(dfw_arg_rel_name))
{ {
const DeferredWork* const arg = work->findArg(dfw _arg_trg_type); const DeferredWork* const arg = work->findArg(dfw _arg_trg_type);
fb_assert(arg); fb_assert(arg);
if (arg) if (arg)
{ {
// ASF: arg->dfw_id is RDB$TRIGGER_TYPE t runcated to USHORT // ASF: arg->dfw_id is RDB$TRIGGER_TYPE t runcated to USHORT
if ((arg->dfw_id & TRIGGER_TYPE_MASK) == TRIGGER_TYPE_DB) if ((arg->dfw_id & TRIGGER_TYPE_MASK) == TRIGGER_TYPE_DB)
{ {
MET_load_trigger(tdbb, NULL, work unsigned triggerKind = arg->dfw_i
->dfw_name, d & ~TRIGGER_TYPE_DB;
&tdbb->getAttachment()->a MET_release_triggers(tdbb, &tdbb-
tt_triggers[arg->dfw_id & ~TRIGGER_TYPE_DB]); >getAttachment()->att_triggers[triggerKind]);
MET_load_db_triggers(tdbb, trigge
rKind);
} }
else if ((arg->dfw_id & TRIGGER_TYPE_MASK ) == TRIGGER_TYPE_DDL) else if ((arg->dfw_id & TRIGGER_TYPE_MASK ) == TRIGGER_TYPE_DDL)
{ {
MET_load_trigger(tdbb, NULL, work MET_release_triggers(tdbb, &tdbb-
->dfw_name, >getAttachment()->att_ddl_triggers);
&tdbb->getAttachment()->a MET_load_ddl_triggers(tdbb);
tt_ddl_triggers);
} }
} }
} }
} }
break; break;
} }
return false; return false;
} }
skipping to change at line 4746 skipping to change at line 4774
// Free any memory associated with the relation's garbage collect ion bitmap // Free any memory associated with the relation's garbage collect ion bitmap
if (dbb->dbb_garbage_collector) { if (dbb->dbb_garbage_collector) {
dbb->dbb_garbage_collector->removeRelation(relation->rel_ id); dbb->dbb_garbage_collector->removeRelation(relation->rel_ id);
} }
if (relation->rel_file) { if (relation->rel_file) {
EXT_fini(relation, false); EXT_fini(relation, false);
} }
RelationPages* relPages = relation->getBasePages(); RelationPages* const relPages = relation->getBasePages();
if (relPages->rel_index_root) { if (relPages->rel_index_root) {
IDX_delete_indices(tdbb, relation, relPages); IDX_delete_indices(tdbb, relation, relPages);
} }
if (relPages->rel_pages) { if (relPages->rel_pages) {
DPM_delete_relation(tdbb, relation); DPM_delete_relation(tdbb, relation);
} }
// if this is a view (or even if we don't know), delete dependenc y lists // if this is a view (or even if we don't know), delete dependenc y lists
skipping to change at line 5958 skipping to change at line 5986
{ {
const DeferredWork* arg = work->findArg(dfw_arg_rel_name) ; const DeferredWork* arg = work->findArg(dfw_arg_rel_name) ;
if (!arg) if (!arg)
{ {
arg = work->findArg(dfw_arg_trg_type); arg = work->findArg(dfw_arg_trg_type);
fb_assert(arg); fb_assert(arg);
// ASF: arg->dfw_id is RDB$TRIGGER_TYPE truncated to USHORT // ASF: arg->dfw_id is RDB$TRIGGER_TYPE truncated to USHORT
if (arg && (arg->dfw_id & TRIGGER_TYPE_MASK) == T RIGGER_TYPE_DB) if (arg && (arg->dfw_id & TRIGGER_TYPE_MASK) == T RIGGER_TYPE_DB)
{ {
MET_release_trigger(tdbb, unsigned triggerKind = arg->dfw_id & ~TRI
&tdbb->getAttachment()->att_trigg GGER_TYPE_DB;
ers[arg->dfw_id & ~TRIGGER_TYPE_DB], MET_release_triggers(tdbb, &tdbb->getAtta
work->dfw_name); chment()->att_triggers[triggerKind]);
MET_load_db_triggers(tdbb, triggerKind);
MET_load_trigger(tdbb, NULL, work->dfw_na }
me, else if ((arg->dfw_id & TRIGGER_TYPE_MASK) == TRI
&tdbb->getAttachment()->att_trigg GGER_TYPE_DDL)
ers[arg->dfw_id & ~TRIGGER_TYPE_DB]); {
MET_release_triggers(tdbb, &tdbb->getAtta
chment()->att_ddl_triggers);
MET_load_ddl_triggers(tdbb);
} }
} }
} }
{ // scope { // scope
const DeferredWork* arg = work->findArg(dfw_arg_check_blr ); const DeferredWork* arg = work->findArg(dfw_arg_check_blr );
if (arg) if (arg)
{ {
const Firebird::MetaName relation_name(arg->dfw_n ame); const Firebird::MetaName relation_name(arg->dfw_n ame);
SSHORT valid_blr = FALSE; SSHORT valid_blr = FALSE;
 End of changes. 6 change blocks. 
20 lines changed or deleted 56 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)