SQL Accounting and Null Attribute Values

Peter Nixon listuser at peternixon.net
Thu Mar 2 08:39:53 CET 2006


On Thu 02 Mar 2006 08:39, trs wrote:
> Accounting queries fail if an attribute is null when supplied as a
> value for certain column types.
> Partial line from debug output:
>
> radius_xlat: 'UPDATE radacct SET AcctStartTime = '2006-03-02
> 01:18:04', AcctStartDelay = '',
>
> It fails with:
>
> rlm_sql (sql): Couldn't update SQL accounting START record - ERROR:
> invalid input syntax for type bigint: ""
>
> Can freeradius substitute a zero if an integer attribute is missing
> from an accounting packet, instead of just a null value?

Yes. You need:

AcctStopDelay = '%{Acct-Delay-Time:-0}'

I already fixed this in the Postgresql queries a long time ago (Several years 
ago from memory). I will check and update the "other" database queries in cvs 
now :-)

If you don't have a particular preference for sql server I recommend using 
Postgresql as I spent allot of time beating on those queries to make them 
robust with many different types of NAS and PG is generally more robust than 
the other databases supported by FreeRADIUS including Oracle (although we 
have a few installations of it for customers who have a "one database to rule 
them all" policy)

Cheers

-- 

Peter Nixon
http://www.peternixon.net/
PGP Key: http://www.peternixon.net/public.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20060302/3a48a536/attachment.pgp>


More information about the Freeradius-Users mailing list