multiple columns in rlm_sql

Alan DeKok aland at deployingradius.com
Fri Apr 13 18:00:36 CEST 2018


On Apr 13, 2018, at 11:40 AM, petr.linke at seznam.cz wrote:
> 
> Hi,
> I have question, is it possible in virtual server config do something like 
> this?
> 
> update control {
>  &value1,&value2, ... ,&valueN="%{sql:SELECT value1,value2, ... ,valueN  
> from some_table where ...}"
> }

  No.

  We have a "map" keyword in v4 which does exactly that.  Back-porting it do v3 is impossible.

> I know, that is no problem to do more sql queries like:
> update control {
>   &value1="%{sql:SELECT value1,from some_table where ...}"
>   &value2="%{sql:SELECT value2,from some_table where ...}"
>    ...
>    &valueN="%{sql:SELECT valueN,from some_table where ...}"
> }
> but it is too expensive for performance, much better is to do with one sql 
> select.

  Yes.  That's why we added "map".

> I looked into rlm_sql.c, and the line #462 - "for (i = 0; i < fields; i++) 
> names[i] = field_info[i].name;" looks as multiple column separation.
> I tried find some info in the freerarius WiKi and in the documentation, but 
> without success.

  The documentation describes what the server does.  If it's not documented, it doesn't exist.

  Alan DeKok.




More information about the Freeradius-Users mailing list