From: Marcin Siodelski Date: Thu, 24 Jan 2019 12:09:37 +0000 (+0100) Subject: [#396,!205] Updated dhcpdb_create.mysql X-Git-Tag: 429-Updated-StampedValue-to-support-reals_base~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8401328a225f04b59b7e07abf9baddeb7f1d27a;p=thirdparty%2Fkea.git [#396,!205] Updated dhcpdb_create.mysql --- diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql index a9d50999b0..e09c988403 100644 --- a/src/share/database/scripts/mysql/dhcpdb_create.mysql +++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql @@ -1372,10 +1372,10 @@ ALTER TABLE dhcp4_audit 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 ; @@ -1576,10 +1576,19 @@ BEGIN # 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.