## This query allocates an IP address from the Pool
## The ORDER BY clause of this query tries to allocate the same IP-address
## to the user that they had last session...
- #allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
- # WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < current_timestamp \
- # ORDER BY (username <> '%{SQL-User-Name}'), \
- # (callingstationid <> '%{Calling-Station-Id}'), expiry_time \
- # LIMIT 1 \
- # FOR UPDATE"
+ allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
+ WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < current_timestamp \
+ AND rownum <= 1 \
+ ORDER BY (username <> '%{SQL-User-Name}'), \
+ (callingstationid <> '%{Calling-Station-Id}'), expiry_time \
+ FOR UPDATE"
## This function is available if you want to use multiple pools
- allocate-find = "select msqlippool('%{SQL-User-Name}','%{control:Pool-Name}') from dual"
+# allocate-find = "select msqlippool('%{SQL-User-Name}','%{control:Pool-Name}') from dual"
## If you prefer to allocate a random IP address every time, use this query instead
#allocate-find = "SELECT framedipaddress FROM ${ippool_table} \
# WHERE pool_name = '%{control:Pool-Name}' AND expiry_time < current_timestamp \
+# AND rownum <= 1 \
# ORDER BY RANDOM() \
- # LIMIT 1 \
# FOR UPDATE"