Skip to content

Commit

Permalink
Fixed the second part of the problem described in CORE-2933: Very slo…
Browse files Browse the repository at this point in the history
…w execution of a script that creates a lot of metadata.
  • Loading branch information
dyemanov committed May 17, 2010
1 parent 48d910f commit c62a17c
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/jrd/vio.cpp
Expand Up @@ -2202,16 +2202,17 @@ void VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb,
EVL_field(0, org_rpb->rpb_record, f_prc_name, &desc1);
SCL_check_procedure(tdbb, &desc1, SCL_protect);
check_class(tdbb, transaction, org_rpb, new_rpb, f_prc_class);
EVL_field(0, org_rpb->rpb_record, f_prc_id, &desc2);
{ // scope
if (dfw_should_know(org_rpb, new_rpb, f_prc_desc, true))
{
EVL_field(0, org_rpb->rpb_record, f_prc_id, &desc2);
const USHORT id = MOV_get_long(&desc2, 0);
DFW_post_work(transaction, dfw_modify_procedure, &desc1, id);
} // scope
}
break;

case rel_gens:
{
EVL_field (0, org_rpb->rpb_record, f_gen_name, &desc1);
EVL_field(0, org_rpb->rpb_record, f_gen_name, &desc1);
// We won't accept modifying sys generators and for user gens,
// only the description.
// This is poor man's version of a trigger discovering changed fields.
Expand All @@ -2227,8 +2228,9 @@ void VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb,
break;

case rel_fields:
check_control(tdbb);
if (dfw_should_know(org_rpb, new_rpb, f_fld_desc, true))
{
check_control(tdbb);
EVL_field(0, org_rpb->rpb_record, f_fld_name, &desc1);
MET_change_fields(tdbb, transaction, &desc1);
EVL_field(0, new_rpb->rpb_record, f_fld_name, &desc2);
Expand Down Expand Up @@ -2263,9 +2265,10 @@ void VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb,
case rel_indices:
EVL_field(0, new_rpb->rpb_record, f_idx_relation, &desc1);
SCL_check_relation(tdbb, &desc1, SCL_control);
EVL_field(0, new_rpb->rpb_record, f_idx_name, &desc1);
if (dfw_should_know(org_rpb, new_rpb, f_idx_desc, true))
{
EVL_field(0, new_rpb->rpb_record, f_idx_name, &desc1);

if (EVL_field(0, new_rpb->rpb_record, f_idx_exp_blr, &desc2))
{
DFW_post_work(transaction, dfw_create_expression_index,
Expand All @@ -2279,14 +2282,17 @@ void VIO_modify(thread_db* tdbb, record_param* org_rpb, record_param* new_rpb,
break;

case rel_triggers:
EVL_field(0, new_rpb->rpb_record, f_trg_rname, &desc1);
SCL_check_relation(tdbb, &desc1, SCL_control);

if (dfw_should_know(org_rpb, new_rpb, f_trg_desc, true))
{
EVL_field(0, new_rpb->rpb_record, f_trg_rname, &desc1);
SCL_check_relation(tdbb, &desc1, SCL_control);
EVL_field(0, new_rpb->rpb_record, f_trg_rname, &desc1);
DFW_post_work(transaction, dfw_update_format, &desc1, 0);
EVL_field(0, org_rpb->rpb_record, f_trg_rname, &desc1);
DFW_post_work(transaction, dfw_update_format, &desc1, 0);
EVL_field(0, org_rpb->rpb_record, f_trg_name, &desc1);

DeferredWork* dw = DFW_post_work(transaction, dfw_modify_trigger, &desc1, 0);

if (EVL_field(0, new_rpb->rpb_record, f_trg_rname, &desc2))
Expand Down

0 comments on commit c62a17c

Please sign in to comment.