# users to keep old addresses after outages
#
+# Using SKIP LOCKED speed up the allocate_find query by 10
+# times. However, it requires MySQL >= 8.0.1, and InnoDB.
+#
+# Uncomment the next line to automatically use SKIP LOCKED
+#skip_locked = "SKIP LOCKED"
+
#
# allocate_clear clears stale IP addresses before processing a new request
#
(callingstationid <> '%{Calling-Station-Id}'), \
expiry_time \
LIMIT 1 \
- FOR UPDATE"
-
-#
-# The above query again, but with SKIP LOCKED. This requires MySQL >= 8.0.1,
-# and InnoDB.
-#
-#allocate_find = "\
-# SELECT framedipaddress FROM ${ippool_table} \
-# WHERE pool_name = '%{control:${pool_name}}' \
-# AND (expiry_time < NOW() OR expiry_time IS NULL) \
-# ORDER BY \
-# (username <> '%{User-Name}'), \
-# (callingstationid <> '%{Calling-Station-Id}'), \
-# expiry_time \
-# LIMIT 1 \
-# FOR UPDATE SKIP LOCKED"
+ FOR UPDATE ${skip_locked}"
#
# If you prefer to allocate a random IP address every time, use this query instead.
# ORDER BY \
# RAND() \
# LIMIT 1 \
-# FOR UPDATE"
+# FOR UPDATE ${skip_locked}"
#
# The above query again, but with SKIP LOCKED. This requires MySQL >= 8.0.1,
#
# $Id$
+# Using SKIP LOCKED speed up the allocate_find query by 10
+# times. However, it requires PostgreSQL >= 9.5.
+#
+# Uncomment the next line to automatically use SKIP LOCKED
+#skip_locked = "SKIP LOCKED"
+
#
# This query allocates an IP address from the Pool
# The ORDER BY clause of this query tries to allocate the same IP-address
(callingstationid <> '%{Calling-Station-Id}'), \
expiry_time \
LIMIT 1 \
- FOR UPDATE"
-
-#
-# The above query again, but with SKIP LOCKED. This requires PostgreSQL >= 9.5.
-#
-#allocate_find = "\
-# SELECT framedipaddress \
-# FROM ${ippool_table} \
-# WHERE pool_name = '%{control:${pool_name}}' \
-# AND expiry_time < 'now'::timestamp(0) \
-# ORDER BY \
-# (username <> '%{SQL-User-Name}'), \
-# (callingstationid <> '%{Calling-Station-Id}'), \
-# expiry_time \
-# LIMIT 1 \
-# FOR UPDATE SKIP LOCKED"
+ FOR UPDATE ${skip_locked}"
#
# If you prefer to allocate a random IP address every time, use this query instead
# WHERE pool_name = '%{control:${pool_name}}' AND expiry_time < 'now'::timestamp(0) \
# ORDER BY RANDOM() \
# LIMIT 1 \
-# FOR UPDATE"
-
-#
-# The above query again, but with SKIP LOCKED. This requires PostgreSQL >= 9.5.
-#
-#allocate_find = "\
-# SELECT framedipaddress FROM ${ippool_table} \
-# WHERE pool_name = '%{control:${pool_name}}' AND expiry_time < 'now'::timestamp(0) \
-# ORDER BY RANDOM() \
-# LIMIT 1 \
-# FOR UPDATE SKIP LOCKED"
+# FOR UPDATE ${skip_locked}"
#
# If an IP could not be allocated, check to see whether the pool exists or not