]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Fix up MS SQL ippool queries
authorNick Porter <nick@portercomputing.co.uk>
Wed, 9 Oct 2024 18:09:52 +0000 (19:09 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Fri, 11 Oct 2024 09:49:22 +0000 (10:49 +0100)
raddb/mods-config/sql/ippool/mssql/queries.conf

index cefcb5c9b06d97f0b490e7fe6e09102723d4b557..24ab4d1b941c7dd6b6272418f92fd072b52decaf 100644 (file)
@@ -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 \
@@ -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 \
@@ -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 \
@@ -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}"