mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-23 22:03:03 +01:00
Fixed Beta2 bug reported in Russian newsgroup : AV when dropping FK
with inactive index. Style
This commit is contained in:
parent
6b2cd1852e
commit
b4f5cb5972
@ -1210,7 +1210,8 @@ void VIO_erase(thread_db* tdbb, record_param* rpb, jrd_tra* transaction)
|
||||
EVL_field(0, rpb->rpb_record, f_idx_relation, &desc);
|
||||
SCL_check_relation(&desc, SCL_control);
|
||||
EVL_field(0, rpb->rpb_record, f_idx_id, &desc2);
|
||||
if ( (id = MOV_get_long(&desc2, 0)) ) {
|
||||
if ( (id = MOV_get_long(&desc2, 0)) )
|
||||
{
|
||||
if (EVL_field(0, rpb->rpb_record, f_idx_exp_blr, &desc2))
|
||||
work = DFW_post_work(transaction, dfw_delete_expression_index, &desc, id);
|
||||
else
|
||||
@ -1221,7 +1222,6 @@ void VIO_erase(thread_db* tdbb, record_param* rpb, jrd_tra* transaction)
|
||||
EVL_field(0, rpb->rpb_record, f_idx_name, &idx_name);
|
||||
DeferredWork* arg = DFW_post_work_arg(transaction, work, &idx_name, id);
|
||||
arg->dfw_type = dfw_arg_index_name;
|
||||
}
|
||||
|
||||
// get partner relation for FK index
|
||||
if (EVL_field(0, rpb->rpb_record, f_idx_foreign, &desc2))
|
||||
@ -1245,13 +1245,15 @@ void VIO_erase(thread_db* tdbb, record_param* rpb, jrd_tra* transaction)
|
||||
DeferredWork* arg = DFW_post_work_arg(transaction, work, 0, partner->rel_id);
|
||||
arg->dfw_type = dfw_arg_partner_rel_id;
|
||||
}
|
||||
else { // can't find partner relation - impossible ?
|
||||
else
|
||||
{ // can't find partner relation - impossible ?
|
||||
// add empty argument to let DFW know dropping
|
||||
// index was bound with FK
|
||||
DeferredWork* arg = DFW_post_work_arg(transaction, work, 0, 0);
|
||||
arg->dfw_type = dfw_arg_partner_rel_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case rel_rfr:
|
||||
|
Loading…
Reference in New Issue
Block a user