From: Nick Porter Date: Wed, 9 Oct 2024 18:09:52 +0000 (+0100) Subject: Fix up MS SQL ippool queries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b8446bac1460df627fa4ca700c7e52ccd673e062;p=thirdparty%2Ffreeradius-server.git Fix up MS SQL ippool queries --- diff --git a/raddb/mods-config/sql/ippool/mssql/queries.conf b/raddb/mods-config/sql/ippool/mssql/queries.conf index cefcb5c9b06..24ab4d1b941 100644 --- a/raddb/mods-config/sql/ippool/mssql/queries.conf +++ b/raddb/mods-config/sql/ippool/mssql/queries.conf @@ -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}"