]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Add open_query to MySQL queries.conf
authorNick Porter <nick@portercomputing.co.uk>
Wed, 26 Jun 2024 12:22:31 +0000 (13:22 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 26 Jun 2024 12:22:31 +0000 (13:22 +0100)
Particularly in the case of sqlippool use, it has been found that
setting the transaction isolation level to READ COMMITTED is needed to
avoid deadlocks.

raddb/mods-config/sql/main/mysql/queries.conf

index e12dbf9537253a569c4831d775172e91f36c0398..c7ee059b769444844ea0de0d58ded1540ea1c70b 100644 (file)
@@ -56,6 +56,16 @@ event_timestamp_epoch = "%{((integer) &Event-Timestamp) || %l}"
 
 event_timestamp = "FROM_UNIXTIME(${event_timestamp_epoch})"
 
+#######################################################################
+# Conection setup query
+#######################################################################
+# This query is run on each new connection when it is first opened.
+# Typically used for setting connection options and not expected
+# to return any results.
+# With MySQL / MariaDB it can be necessary to amend the transaction
+# isolation level to prevent gap locks creating deadlocks.
+# open_query = "SET TRANSACTION ISOLATION LEVEL READ COMMITTED"
+
 #######################################################################
 # Authorization Queries
 #######################################################################