From: Alan T. DeKok Date: Fri, 6 Nov 2020 16:00:17 +0000 (-0500) Subject: add "SELECT true" as fail-over for on/off queries X-Git-Tag: release_3_0_22~349 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=42229e776;p=thirdparty%2Ffreeradius-server.git add "SELECT true" as fail-over for on/off queries 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" --- diff --git a/raddb/mods-config/sql/main/mssql/queries.conf b/raddb/mods-config/sql/main/mssql/queries.conf index ee21f740e5a..73dc8db66f3 100644 --- a/raddb/mods-config/sql/main/mssql/queries.conf +++ b/raddb/mods-config/sql/main/mssql/queries.conf @@ -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" } # diff --git a/raddb/mods-config/sql/main/mysql/queries.conf b/raddb/mods-config/sql/main/mysql/queries.conf index 51560a71ed8..2ed45feecd3 100644 --- a/raddb/mods-config/sql/main/mysql/queries.conf +++ b/raddb/mods-config/sql/main/mysql/queries.conf @@ -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" } # diff --git a/raddb/mods-config/sql/main/postgresql/queries.conf b/raddb/mods-config/sql/main/postgresql/queries.conf index b868238306a..91783889cc2 100644 --- a/raddb/mods-config/sql/main/postgresql/queries.conf +++ b/raddb/mods-config/sql/main/postgresql/queries.conf @@ -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" } # diff --git a/raddb/mods-config/sql/main/sqlite/queries.conf b/raddb/mods-config/sql/main/sqlite/queries.conf index ef413138781..678ecdfc953 100644 --- a/raddb/mods-config/sql/main/sqlite/queries.conf +++ b/raddb/mods-config/sql/main/sqlite/queries.conf @@ -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" } #