]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#1928] Fix class ordering procedure
authorMarcin Siodelski <marcin@isc.org>
Tue, 13 Jul 2021 10:39:56 +0000 (12:39 +0200)
committerMarcin Siodelski <marcin@isc.org>
Wed, 21 Jul 2021 10:49:50 +0000 (10:49 +0000)
The comparison of follow_class_name values during the class update must
take into account the case when both values are NULL.

src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_9.6_to_10.0.sh.in

index 5d95fc39ad8187f0091bc0d312fe5bbd16028652..e862e9aa9eea0215be9581ac6f84fa49b8ae16f9 100644 (file)
@@ -3185,7 +3185,11 @@ proc_label:BEGIN
     );
 
     -- Bail if the class is updated without re-positioning.
-    IF (@depend_on_known_indirectly IS NOT NULL AND follow_class_name = old_follow_class_name) THEN
+    IF(
+        @depend_on_known_indirectly IS NOT NULL AND
+        ((follow_class_name IS NULL AND old_follow_class_name IS NULL) OR
+         (follow_class_name = old_follow_class_name))
+    ) THEN
         -- The depend_on_known_indirectly is set to 0 because this procedure is invoked
         -- whenever the dhcp4_client_class record is updated. Such update may include
         -- test expression changes impacting the dependency on KNOWN/UNKNOWN classes.
@@ -3641,7 +3645,11 @@ proc_label:BEGIN
     );
 
     -- Bail if the class is updated without re-positioning.
-    IF (@depend_on_known_indirectly IS NOT NULL AND follow_class_name = old_follow_class_name) THEN
+    IF(
+        @depend_on_known_indirectly IS NOT NULL AND
+        ((follow_class_name IS NULL AND old_follow_class_name IS NULL) OR
+         (follow_class_name = old_follow_class_name))
+    ) THEN
         -- The depend_on_known_indirectly is set to 0 because this procedure is invoked
         -- whenever the dhcp6_client_class record is updated. Such update may include
         -- test expression changes impacting the dependency on KNOWN/UNKNOWN classes.
index ae3dcbed6b531a51053b39e08e418814571d972e..3b0be33b0e2940ce0e25c6c86e3b7104117a5c54 100644 (file)
@@ -133,7 +133,11 @@ proc_label:BEGIN
     );
 
     -- Bail if the class is updated without re-positioning.
-    IF (@depend_on_known_indirectly IS NOT NULL AND follow_class_name = old_follow_class_name) THEN
+    IF(
+        @depend_on_known_indirectly IS NOT NULL AND
+        ((follow_class_name IS NULL AND old_follow_class_name IS NULL) OR
+         (follow_class_name = old_follow_class_name))
+    ) THEN
         -- The depend_on_known_indirectly is set to 0 because this procedure is invoked
         -- whenever the dhcp4_client_class record is updated. Such update may include
         -- test expression changes impacting the dependency on KNOWN/UNKNOWN classes.
@@ -589,7 +593,11 @@ proc_label:BEGIN
     );
 
     -- Bail if the class is updated without re-positioning.
-    IF (@depend_on_known_indirectly IS NOT NULL AND follow_class_name = old_follow_class_name) THEN
+    IF(
+        @depend_on_known_indirectly IS NOT NULL AND
+        ((follow_class_name IS NULL AND old_follow_class_name IS NULL) OR
+         (follow_class_name = old_follow_class_name))
+    ) THEN
         -- The depend_on_known_indirectly is set to 0 because this procedure is invoked
         -- whenever the dhcp6_client_class record is updated. Such update may include
         -- test expression changes impacting the dependency on KNOWN/UNKNOWN classes.