]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#396,!205] Updated dhcpdb_create.mysql
authorMarcin Siodelski <marcin@isc.org>
Thu, 24 Jan 2019 12:09:37 +0000 (13:09 +0100)
committerMarcin Siodelski <marcin@isc.org>
Wed, 30 Jan 2019 09:18:59 +0000 (10:18 +0100)
src/share/database/scripts/mysql/dhcpdb_create.mysql

index a9d50999b0f7196d935000e0cebe4f6f02a8ef2f..e09c988403e1877e379b0a917b557929894ca430 100644 (file)
@@ -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.