mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-24 06:03:02 +01:00
Hopefully, this should fix SF #1404157.
This commit is contained in:
parent
f0d6bdeea0
commit
2b10a0e4b7
@ -2010,25 +2010,42 @@ static bool create_relation(thread_db* tdbb,
|
|||||||
if (!REQUEST(irq_c_relation))
|
if (!REQUEST(irq_c_relation))
|
||||||
REQUEST(irq_c_relation) = request;
|
REQUEST(irq_c_relation) = request;
|
||||||
|
|
||||||
/* If relation wasn't found, don't do anymore. This can happen
|
/* if this is not a view, create the relation */
|
||||||
when the relation is created and deleted in the same transaction. */
|
|
||||||
|
|
||||||
if (!rel_id)
|
if (rel_id && blob_id.isEmpty() && !external_flag)
|
||||||
break;
|
{
|
||||||
|
relation = MET_relation(tdbb, rel_id);
|
||||||
|
DPM_create_relation(tdbb, relation);
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 4:
|
||||||
|
|
||||||
/* get the relation and flag it to check for dependencies
|
/* get the relation and flag it to check for dependencies
|
||||||
in the view blr (if it exists) and any computed fields */
|
in the view blr (if it exists) and any computed fields */
|
||||||
|
|
||||||
|
request = CMP_find_request(tdbb, irq_c_relation2, IRQ_REQUESTS);
|
||||||
|
|
||||||
|
FOR(REQUEST_HANDLE request)
|
||||||
|
X IN RDB$RELATIONS WITH
|
||||||
|
X.RDB$RELATION_NAME EQ work->dfw_name.c_str()
|
||||||
|
|
||||||
|
if (!REQUEST(irq_c_relation2))
|
||||||
|
REQUEST(irq_c_relation2) = request;
|
||||||
|
|
||||||
|
rel_id = X.RDB$RELATION_ID;
|
||||||
relation = MET_relation(tdbb, rel_id);
|
relation = MET_relation(tdbb, rel_id);
|
||||||
relation->rel_flags |= REL_get_dependencies;
|
relation->rel_flags |= REL_get_dependencies;
|
||||||
|
|
||||||
/* if this is not a view, create the relation */
|
relation->rel_flags &= ~REL_scanned;
|
||||||
|
DFW_post_work(transaction, dfw_scan_relation, NULL, rel_id);
|
||||||
|
|
||||||
|
END_FOR;
|
||||||
|
|
||||||
|
if (!REQUEST(irq_c_relation2))
|
||||||
|
REQUEST(irq_c_relation2) = request;
|
||||||
|
|
||||||
if (blob_id.isEmpty())
|
|
||||||
{
|
|
||||||
if (!external_flag)
|
|
||||||
DPM_create_relation(tdbb, relation);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4426,6 +4443,14 @@ static bool scan_relation(thread_db* tdbb, SSHORT phase, DeferredWork* work,
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
// dimitr: I suspect that nobody expects an updated format to
|
||||||
|
// appear at stage 3, so the logic would work reliably
|
||||||
|
// if this line is removed (and hence we rely on the
|
||||||
|
// 4th stage only). But I leave it here for the time being.
|
||||||
|
MET_scan_relation(tdbb, MET_relation(tdbb, work->dfw_id));
|
||||||
|
return true;
|
||||||
|
|
||||||
|
case 4:
|
||||||
MET_scan_relation(tdbb, MET_relation(tdbb, work->dfw_id));
|
MET_scan_relation(tdbb, MET_relation(tdbb, work->dfw_id));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -111,7 +111,8 @@ const int irq_l_relation_defsec = 74; /* check the default sec class name agains
|
|||||||
const int irq_m_index_seg = 75; /* modify per-segment index selectivity */
|
const int irq_m_index_seg = 75; /* modify per-segment index selectivity */
|
||||||
|
|
||||||
const int irq_l_subtype = 76; /* lookup subtype (charset/collation) */
|
const int irq_l_subtype = 76; /* lookup subtype (charset/collation) */
|
||||||
|
const int irq_c_relation2 = 77; /* create new relation */
|
||||||
|
|
||||||
const int irq_MAX = 77;
|
const int irq_MAX = 78;
|
||||||
|
|
||||||
#endif /* JRD_IRQ_H */
|
#endif /* JRD_IRQ_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user