On Jul 8, 2015, at 9:15 AM, Renato Sousa <rensousa@gmail.com> wrote:
Hello Alan,
I checked the file /usr/local/etc/raddb/mods-config/sql/main/mysql/queries.conf and contains FROM_UNIXTIME () functions. The file keeps the default installation settings.
start { # # Insert a new record into the sessions table # query = "\ INSERT INTO ${....acct_table1} \ (${...column_list}) \ VALUES \ ('%{Acct-Session-Id}', \ '%{Acct-Unique-Session-Id}', \ '%{SQL-User-Name}', \ '%{Realm}', \ '%{NAS-IP-Address}', \ '%{NAS-Port}', \ '%{NAS-Port-Type}', \
*FROM_UNIXTIME*(%{integer:Event-Timestamp}), \ * FROM_UNIXTIME*(%{integer:Event-Timestamp}), \ NULL, \ '0', \ '%{Acct-Authentic}', \ '%{Connect-Info}', \ '', \ '0', \ '0', \ '%{Called-Station-Id}', \ '%{Calling-Station-Id}', \ '', \ '%{Service-Type}', \ '%{Framed-Protocol}', \ '%{Framed-IP-Address}')"
Why freeradius does not perform the function in the query?
Because it's easier to use the server side functions to convert the unix timestamps into native date types, instead of writing code to format the timestamps for specific database flavours. -Arran