SQL query difficulties

Alan DeKok aland at deployingradius.com
Tue Dec 9 19:35:00 CET 2014


On Dec 9, 2014, at 12:08 PM, Dave Aldwinckle <daldwinc at uwaterloo.ca> wrote:
> When I run an SQL query from freeradius, I get no results. When I copy and paste the query into mysql, there is a result. Configs and debug below; help is appreciated.
> ...
>                if("%{sql:SELECT COUNT(macaddress) FROM `radmacauthgroup` WHERE macaddress = '%{User-Name}'" > 0){

  That query has a typo.  It *should* be caught, but the parser isn’t (yet) smart enough to look that deeply into strings.

  You’re missing a closing brace at the end of the string: … ‘%{User-Name}’}"

  I’ll see if I can add a test case to catch this.

  Alan DeKok.



More information about the Freeradius-Users mailing list