Accounting Start Time in Interim-Update of queries.conf is written differently between MySQL and Postgresql

Alan DeKok aland at deployingradius.com
Fri Aug 18 14:56:38 UTC 2023


On Aug 18, 2023, at 5:40 AM, Ibrahim Al Mahfooz <ibrahim.nezar at sevennet.net> wrote:
> The differences are in the accounting start time inside the interim-update
> section:
> - In mysql it is written as:
> FROM_UNIXTIME(${....event_timestamp_epoch} - %{%{Acct-Session-Time}:-0}), \
> 
> - While in postgresql it is:
> ${....event_timestamp}, \

  It's that way in mssql and Oracle, too.  Those need fixing.

> I found that the line in postgresql queries actually causing the start to
> be inaccurate since it will reflect current time while it should reflect
> the elapsed time (current time - accounting session time)
> 
> Having this, I had to change the line to this and it seems to be working:
> TO_TIMESTAMP(${....event_timestamp_epoch} - %{%{Acct-Session-Time}:-0}), \

  I'll push a fix.

> Any reason why it is not written with the same logic of MySQL queries file?

  It was missed I guess.

> Will the change I made impose any risks or issues down the road?

  No.

  Alan DeKok.



More information about the Freeradius-Users mailing list