Sql Counter reads only the first 4 digits

Ivan Kalik tnt at kalik.net
Wed May 20 14:56:31 CEST 2009


> Mauro Iorio - Smart Soft s.r.l. wrote:
>> I’ve a strange problem with sql counter on freeradius both 1.1.7 and
>> 2.1.5 versions.
>>
>> Actually executing
>>
>> SELECT SUM(AcctSessionTime) FROM radacct WHERE UserName='mauro'
>
>   What happens when you replace that SELECT statement with a hard-coded
> number, like 123456?  Does it still truncate the result?
>
>   Alan DeKok.
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html

I can't replicate this. 2.1.6 prerelease on Slackware.

sqlcounter_expand:  '%{sql:SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='kaliki'}'
[noresetcounter] sql_xlat
[noresetcounter]        expand: %{Stripped-User-Name} ->
[noresetcounter]        expand: %{User-Name} -> kaliki
[noresetcounter]        expand: %{%{User-Name}:-DEFAULT} -> kaliki
[noresetcounter]        expand:
%{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} -> kaliki
[noresetcounter] sql_set_user escaped user --> 'kaliki'
[noresetcounter]        expand: SELECT SUM(AcctSessionTime) FROM radacct
WHERE UserName='kaliki' -> SELECT SUM(AcctSessionTime) FROM radacct WHERE
UserName='kaliki'
rlm_sql (sql): Reserving sql socket id: 2
[noresetcounter] sql_xlat finished
rlm_sql (sql): Released sql socket id: 2
[noresetcounter]        expand: %{sql:SELECT SUM(AcctSessionTime) FROM
radacct WHERE UserName='kaliki'} -> 1289790
rlm_sqlcounter: (Check item - counter) is less than zero
rlm_sqlcounter: Rejected user kaliki, check_item=3600, counter=1289790
++[noresetcounter] returns reject


Ivan Kalik
Kalik Informatika ISP




More information about the Freeradius-Users mailing list