From: Marcin Siodelski Date: Tue, 13 Jul 2021 10:39:56 +0000 (+0200) Subject: [#1928] Fix class ordering procedure X-Git-Tag: Kea-1.9.10~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=084200867670b1c0f2fece4ef9636b3cf96fc5c9;p=thirdparty%2Fkea.git [#1928] Fix class ordering procedure The comparison of follow_class_name values during the class update must take into account the case when both values are NULL. --- diff --git a/src/share/database/scripts/mysql/dhcpdb_create.mysql b/src/share/database/scripts/mysql/dhcpdb_create.mysql index 5d95fc39ad..e862e9aa9e 100644 --- a/src/share/database/scripts/mysql/dhcpdb_create.mysql +++ b/src/share/database/scripts/mysql/dhcpdb_create.mysql @@ -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. diff --git a/src/share/database/scripts/mysql/upgrade_9.6_to_10.0.sh.in b/src/share/database/scripts/mysql/upgrade_9.6_to_10.0.sh.in index ae3dcbed6b..3b0be33b0e 100644 --- a/src/share/database/scripts/mysql/upgrade_9.6_to_10.0.sh.in +++ b/src/share/database/scripts/mysql/upgrade_9.6_to_10.0.sh.in @@ -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.