8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 14:03:02 +01:00

Fixed the second part of the problem described in CORE-2933: Very slow execution of a script that creates a lot of metadata.

This commit is contained in:
dimitr 2010-05-17 09:54:56 +00:00
parent 48d910f641
commit c62a17ca3c

View File

@ -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.
@ -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);
@ -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,
@ -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))