]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
add "SELECT true" as fail-over for on/off queries
authorAlan T. DeKok <aland@freeradius.org>
Fri, 6 Nov 2020 16:00:17 +0000 (11:00 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 6 Nov 2020 16:00:17 +0000 (11:00 -0500)
If there are no rows to update, then the on/off queries will
return "no rows updated".  The server will then fail over to the
next query, which says "that's fine"

raddb/mods-config/sql/main/mssql/queries.conf
raddb/mods-config/sql/main/mysql/queries.conf
raddb/mods-config/sql/main/postgresql/queries.conf
raddb/mods-config/sql/main/sqlite/queries.conf

index ee21f740e5a385071560e48fd3b9c57e11be09d1..73dc8db66f3008652296a72370d6c748972feaac 100644 (file)
@@ -134,10 +134,19 @@ accounting {
                                WHERE AcctStopTime = 0 \
                                AND NASIPAddress = '%{NAS-IP-Address}' \
                                AND AcctStartTime <= ${....event_timestamp}"
+
+                       #
+                       #  If there are no open user sessions, then the previous query
+                       #  will return "no rows updated".  The server will then fall through
+                       #  to the next query, which is just "yes, that's fine".
+                       #
+                       query = "SELECT true"
                }
 
                accounting-off {
                        query = "${..accounting-on.query}"
+
+                       query = "SELECT true"
                }
 
                #
index 51560a71ed819a95bc0f5ccc352efe69e374f7c5..2ed45feecd30dbef2714fb2f4879a1fbf1aeefd8 100644 (file)
@@ -254,10 +254,19 @@ accounting {
                                WHERE acctstoptime IS NULL \
                                AND nasipaddress   = '%{NAS-IP-Address}' \
                                AND acctstarttime <= ${....event_timestamp}"
+
+                       #
+                       #  If there are no open user sessions, then the previous query
+                       #  will return "no rows updated".  The server will then fall through
+                       #  to the next query, which is just "yes, that's fine".
+                       #
+                       query = "SELECT true"
                }
 
                accounting-off {
                        query = "${..accounting-on.query}"
+
+                       query = "SELECT true"
                }
 
                #
index b868238306ae6344a1295ae9dedbd292fba76bec..91783889cc2619b1f2f0e5944a91ab35ca48a9c4 100644 (file)
@@ -290,10 +290,19 @@ accounting {
                                WHERE AcctStopTime IS NULL \
                                AND NASIPAddress= '%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}}' \
                                AND AcctStartTime <= ${....event_timestamp}"
+
+                       #
+                       #  If there are no open user sessions, then the previous query
+                       #  will return "no rows updated".  The server will then fall through
+                       #  to the next query, which is just "yes, that's fine".
+                       #
+                       query = "SELECT true"
                }
 
                accounting-off {
                        query = "${..accounting-on.query}"
+
+                       query = "SELECT true"
                }
 
                #
index ef4131387813ef961e39f8f002ab6a322990152d..678ecdfc9533538dce202651ac458605aa142c4a 100644 (file)
@@ -254,10 +254,19 @@ accounting {
                                WHERE acctstoptime IS NULL \
                                AND nasipaddress = '%{NAS-IP-Address}' \
                                AND acctstarttime <= ${....event_timestamp}"
+
+                       #
+                       #  If there are no open user sessions, then the previous query
+                       #  will return "no rows updated".  The server will then fall through
+                       #  to the next query, which is just "yes, that's fine".
+                       #
+                       query = "SELECT true"
                }
 
                accounting-off {
                        query = "${..accounting-on.query}"
+
+                       query = "SELECT true"
                }
 
                #