MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / create_trigger

Function create_trigger

src/gpre/cmd.cpp:1669–1700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1667//
1668
1669static void create_trigger(gpre_req* request,
1670 const act* action,
1671 gpre_trg* trigger, pfn_local_trigger_cb routine)
1672{
1673 const gpre_rel* relation = (gpre_rel*) action->act_object;
1674
1675 // Name of trigger to be generated
1676
1677 put_cstring(request, isc_dyn_def_trigger, "");
1678
1679 put_symbol(request, isc_dyn_rel_name, relation->rel_symbol);
1680 put_numeric(request, isc_dyn_trg_type, trigger->trg_type);
1681 put_numeric(request, isc_dyn_trg_sequence, 0);
1682 put_numeric(request, isc_dyn_trg_inactive, 0);
1683 request->add_byte(isc_dyn_sql_object);
1684
1685 if (trigger->trg_source != NULL)
1686 put_cstring(request, isc_dyn_trg_source, trigger->trg_source->str_string);
1687
1688 if (trigger->trg_message != NULL)
1689 {
1690 put_numeric(request, isc_dyn_def_trigger_msg, 1);
1691 put_cstring(request, isc_dyn_trg_msg, trigger->trg_message->str_string);
1692 request->add_byte(isc_dyn_end);
1693 }
1694
1695 // Generate the BLR for firing the trigger
1696
1697 put_trigger_blr(request, isc_dyn_trg_blr, trigger->trg_boolean, routine);
1698
1699 request->add_end();
1700}
1701
1702
1703//____________________________________________________________

Callers 1

create_check_constraintFunction · 0.85

Calls 6

put_cstringFunction · 0.85
put_symbolFunction · 0.85
put_trigger_blrFunction · 0.85
add_endMethod · 0.80
put_numericFunction · 0.70
add_byteMethod · 0.45

Tested by

no test coverage detected