Possible bug in rlm_sqlcounter examples

Phil Mayers p.mayers at imperial.ac.uk
Wed Feb 22 10:19:33 CET 2012


On 02/21/2012 11:04 PM, Tim White wrote:
> Following on from my previous email, I've checked an x86 machine as
> well, and get the same behaviour.

I should hope so; SQL is not architecture specific!

Your original solution was correct as far as I could see; if there's any 
chance a column might be absent/null, coalesce or nullif are required. I 
don't use rlm_sqlcounter so can't say whether absent/null values are 
expected or a peculiarity of your setup, but a mix of both is possible.

>
> Debug logs follow, the first being the initial login for the day,
> showing sqlcounter not finding an integer and hence returning noop. The
> second being after an initial login where a correct integer is returned.
>
> Can anyone else confirm that the example sqlcounter queries are at fault
> and that we need ether an IFNULL or COALESCE surrounding the SUM? I'll
> be updating the Grase Hotspot files, but I'm wondering if a change was
> made in rlm_sqlcounter in the last few months (year) that has caused it
> to treat NULL as NULL and not as 0, and hence the SQL queries need to be
> updated?

Try looking through the source code history:

https://github.com/alandekok/freeradius-server



More information about the Freeradius-Users mailing list