# allocate-clear = "UPDATE ${ippool_table} \
# SET nasipaddress = '', pool_key = 0, \
# callingstationid = '', username = '', \
-# expiry_time IS NULL \
+# expiry_time = NULL \
# WHERE pool_key = '${pool-key}'"
## This series of queries allocates an IP address
allocate-clear = "UPDATE ${ippool_table} \
SET nasipaddress = '', pool_key = 0, \
callingstationid = '', username = '', \
- expiry_time IS NULL \
+ expiry_time = NULL \
WHERE expiry_time <= NOW() - INTERVAL 1 SECOND \
AND nasipaddress = '%{Nas-IP-Address}'"
## STOP record arrives
stop-clear = "UPDATE ${ippool_table} \
SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
- expiry_time IS NULL \
+ expiry_time = NULL \
WHERE nasipaddress = '%{Nas-IP-Address}' AND pool_key = '${pool-key}' \
AND username = '%{User-Name}' \
AND callingstationid = '%{Calling-Station-Id}' \
## NAS when an accounting ON record arrives
on-clear = "UPDATE ${ippool_table} \
SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
- expiry_time IS NULL \
+ expiry_time = NULL \
WHERE nasipaddress = '%{Nas-IP-Address}'"
## This series of queries frees the IP numbers allocate to a
## NAS when an accounting OFF record arrives
off-clear = "UPDATE ${ippool_table} \
SET nasipaddress = '', pool_key = 0, callingstationid = '', username = '', \
- expiry_time IS NULL \
+ expiry_time = NULL \
WHERE nasipaddress = '%{Nas-IP-Address}'"