Skip to content

Commit

Permalink
Fix up MS SQL ippool queries
Browse files Browse the repository at this point in the history
  • Loading branch information
ndptech committed Oct 11, 2024
1 parent fe0e4d3 commit b8446ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions raddb/mods-config/sql/ippool/mssql/queries.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ alloc_commit = ""
# Attempt to find the most recent existing IP address for the client
#
alloc_existing = "\
WITH cte AS (
WITH cte AS ( \
SELECT TOP(1) address, expiry_time, gateway \
FROM ${ippool_table} WITH (xlock rowlock readpast) \
JOIN fr_ippool_status ON ${ippool_table}.status_id = fr_ippool_status.status_id \
Expand All @@ -42,7 +42,7 @@ alloc_existing = "\
# Determine whether the requested IP address is available
#
alloc_requested = "\
WITH cte AS (
WITH cte AS ( \
SELECT TOP(1) address, expiry_time, gateway \
FROM ${ippool_table} WITH (xlock rowlock readpast) \
JOIN fr_ippool_status ON ${ippool_table}.status_id = fr_ippool_status.status_id \
Expand All @@ -63,7 +63,7 @@ alloc_requested = "\
# find a free address
#
alloc_find = "\
WITH cte AS (
WITH cte AS ( \
SELECT TOP(1) address, expiry_time, gateway, owner \
FROM ${ippool_table} WITH (xlock rowlock readpast) \
JOIN fr_ippool_status ON ${ippool_table}.status_id = fr_ippool_status.status_id \
Expand All @@ -74,7 +74,7 @@ alloc_find = "\
) \
UPDATE cte \
SET expiry_time = DATEADD(SECOND,${offer_duration},CURRENT_TIMESTAMP), \
gateway = '${gateway}' \
gateway = '${gateway}', \
owner = '${owner}' \
OUTPUT INSERTED.address \
FROM ${ippool_table}"
Expand Down

0 comments on commit b8446ba

Please sign in to comment.