Skip to content

Commit 534b050

Browse files
committed
[#4373] Fix postgresql pick logic
Fix the if clause on the second try pick in sflqPickFreeLease* modified: src/share/database/scripts/pgsql/dhcpdb_create.pgsql modified: src/share/database/scripts/pgsql/upgrade_032_to_033.sh.in
1 parent 0f9d359 commit 534b050

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/share/database/scripts/pgsql/dhcpdb_create.pgsql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6945,7 +6945,7 @@ BEGIN
69456945
-- Didn't find one, so try front half of the range, including
69466946
-- the last pick. This avoids returning nothing if there is only
69476947
-- one address free.
6948-
IF (free_address IS NULL AND last_address != p_start_address)
6948+
IF (free_address IS NULL)
69496949
THEN
69506950
SELECT f.address INTO free_address FROM free_lease4 f
69516951
LEFT JOIN lease4 ON f.address = lease4.address
@@ -7300,7 +7300,7 @@ BEGIN
73007300
-- Didn't find one, so try front half of the range, including
73017301
-- the last pick. This avoids returning nothing if there is only
73027302
-- one address free.
7303-
IF (free_address IS NULL AND bin_last_address != bin_start_address)
7303+
IF (free_address IS NULL)
73047304
THEN
73057305
SELECT f.address INTO free_address FROM free_lease6 f
73067306
LEFT JOIN lease6 on f.address = lease6.address

src/share/database/scripts/pgsql/upgrade_032_to_033.sh.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ BEGIN
231231
-- Didn't find one, so try front half of the range, including
232232
-- the last pick. This avoids returning nothing if there is only
233233
-- one address free.
234-
IF (free_address IS NULL AND last_address != p_start_address)
234+
IF (free_address IS NULL)
235235
THEN
236236
SELECT f.address INTO free_address FROM free_lease4 f
237237
LEFT JOIN lease4 ON f.address = lease4.address
@@ -587,7 +587,7 @@ BEGIN
587587
-- Didn't find one, so try front half of the range, including
588588
-- the last pick. This avoids returning nothing if there is only
589589
-- one address free.
590-
IF (free_address IS NULL AND bin_last_address != bin_start_address)
590+
IF (free_address IS NULL)
591591
THEN
592592
SELECT f.address INTO free_address FROM free_lease6 f
593593
LEFT JOIN lease6 on f.address = lease6.address

0 commit comments

Comments
 (0)