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

Function create_check_constraint

src/gpre/cmd.cpp:427–451  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

425//
426
427static void create_check_constraint( gpre_req* request, const act* action,
428 cnstrt* constraint)
429{
430 gpre_trg* trigger = (gpre_trg*) MSC_alloc(TRG_LEN);
431
432 // create the INSERT trigger
433
434 trigger->trg_type = PRE_STORE_TRIGGER;
435
436 // "insert violates CHECK constraint on table"
437
438 trigger->trg_message = NULL;
439 trigger->trg_boolean = constraint->cnstrt_boolean;
440 trigger->trg_source = (STR) MSC_alloc(constraint->cnstrt_text->txt_length + 1);
441 CPR_get_text(trigger->trg_source->str_string, constraint->cnstrt_text);
442 create_trigger(request, action, trigger, CME_expr);
443
444 // create the UPDATE trigger
445
446 trigger->trg_type = PRE_MODIFY_TRIGGER;
447
448 // "update violates CHECK constraint on table"
449
450 create_trigger(request, action, trigger, CME_expr);
451}
452
453
454//____________________________________________________________

Callers 1

create_constraintFunction · 0.85

Calls 3

MSC_allocFunction · 0.85
CPR_get_textFunction · 0.85
create_triggerFunction · 0.85

Tested by

no test coverage detected