DROP PROCEDURE IF EXISTS initAuditRevision;
DELIMITER $$
CREATE PROCEDURE initAuditRevision(IN log_message TEXT,
- IN distinct_transaction TINYINT(1))
+ IN cascade_transaction TINYINT(1))
BEGIN
SET @audit_log_message = log_message;
- SET @distinct_transaction = distinct_transaction;
+ SET @cascade_transaction = cascade_transaction;
SET @audit_revision_id = NULL;
END $$
DELIMITER ;
# by matching it name.
DECLARE snid VARCHAR(128);
- # Distinct transaction flag is set when audit entry must be
- # associated with the option. For example: adding a global
- # option or adding an option to the existing subnet etc.
- IF @distinct_transaction != 0 THEN
+ # Cascade transaction flag is set to 1 to prevent creation of
+ # the audit entries for the options when the options are
+ # created as part of the parent object creation or update.
+ # For example: when the option is added as part of the subnet
+ # addition, the cascade transaction flag is equal to 1. If
+ # the option is added into the existing subnet the cascade
+ # transaction is equal to 0. Note that depending on the option
+ # scope the audit entry will contain the object_type value
+ # of the parent object to cause the server to replace the
+ # entire subnet. The only case when the object_type will be
+ # set to 'dhcp4_options' is when the global option is added.
+ # Global options do not have the owner.
+ IF @cascade_transaction == 0 THEN
IF scope_id = 0 THEN
# If a global option is added or modified, create audit
# entry for the 'dhcp4_options' table.