From: Nick Porter Date: Wed, 26 Jun 2024 12:22:31 +0000 (+0100) Subject: Add open_query to MySQL queries.conf X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f186a5ea3e3666bd229fcc6f568bf417bf8902df;p=thirdparty%2Ffreeradius-server.git Add open_query to MySQL queries.conf 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. --- diff --git a/raddb/mods-config/sql/main/mysql/queries.conf b/raddb/mods-config/sql/main/mysql/queries.conf index e12dbf95372..c7ee059b769 100644 --- a/raddb/mods-config/sql/main/mysql/queries.conf +++ b/raddb/mods-config/sql/main/mysql/queries.conf @@ -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 #######################################################################