Max length of SQl return string?

Alexander Silveröhrt Alexander.Silverohrt at itux.se
Thu Nov 28 15:41:27 CET 2013


Hello,

We are doing a query which are supposed to comeback with a bunch of subscriber accounts.

 update request {
                Subscriber-Accounts := "%{sql-cisco-bng:SELECT GROUP_CONCAT(username SEPARATOR ';') FROM radcheck WHERE username LIKE '%{User-Name}%%'}"
 }

But it seems that there is a limit on how long the return string can be?
In this case a query for acccount for user "10.33.2.3_GigabitEthernet0/0/2" did return below accounts but the return query cuts off after a while. (And yes port 1 and port 2 also gets account for 10-19 and 20-22 which is why we noticed this bugg/feature..?)

10.33.2.3_GigabitEthernet0/0/21
10.33.2.3_GigabitEthernet0/0/20 CH_VoIP
10.33.2.3_GigabitEthernet0/0/20 CH_IPTV
10.33.2.3_GigabitEthernet0/0/20
10.33.2.3_GigabitEthernet0/0/2 KAL_IPTV
10.33.2.3_GigabitEthernet0/0/20 KAL_IPTV
10.33.2.3_GigabitEthernet0/0/2

Here is from the debug where one can see where it gets cut off
rlm_perl: sub-pre-auth: Debug: RAD_REQUEST in sub authorize: Subscriber-Accounts = 10.33.2.3_GigabitEthernet0/0/21;10.33.2.3_GigabitEthernet0/0/20 CH_VoIP;10.33.2.3_GigabitEthernet0/0/20 CH_IPTV;10.33.2.3_GigabitEthernet0/0/20;10.33.2.3_GigabitEthernet0/0/2 KAL_IPTV;10.33.2.3_GigabitEthernet0/0/20 KAL_IPTV;10.33.2.3_GigabitEth

And and after splitted
rlm_perl: sub-pre-auth: i = 0, SQL Found Account[0]: 10.33.2.3_GigabitEthernet0/0/21
rlm_perl: sub-pre-auth: i = 1, SQL Found Account[1]: 10.33.2.3_GigabitEthernet0/0/20 CH_VoIP
rlm_perl: sub-pre-auth: i = 2, SQL Found Account[2]: 10.33.2.3_GigabitEthernet0/0/20 CH_IPTV
rlm_perl: sub-pre-auth: i = 3, SQL Found Account[3]: 10.33.2.3_GigabitEthernet0/0/20
rlm_perl: sub-pre-auth: i = 4, SQL Found Account[4]: 10.33.2.3_GigabitEthernet0/0/2 KALEJDO_IPTV
rlm_perl: sub-pre-auth: i = 5, SQL Found Account[5]: 10.33.2.3_GigabitEthernet0/0/20 KALEJDO_IPTV
rlm_perl: sub-pre-auth: i = 6, SQL Found Account[6]: 10.33.2.3_GigabitEth

So my question is if there is a limitation can i change it somewhere and why is there one in the first place?

We temporary fixed it by a better matched SQL query which doesnt give us accounts we are not asking for..
Subscriber-Accounts := "%{sql-cisco-bng:SELECT GROUP_CONCAT(username SEPARATOR ';') AS FOO_RID FROM radcheck WHERE username LIKE '%{User-Name} %' OR username = '%{User-Name}'}"

but it is still going to give us problems in the future since users can have more than above exemples of accounts.

Thanks for your time.

Alex

********* DISCLAIMER *********

This message and any attachment are confidential and may be privileged or otherwise protected from disclosure and may include proprietary information. If you are not the intended recipient, please telephone or email the sender and delete this message and any attachment from your system. If you are not the intended recipient you must not copy this message or attachment or disclose the contents to any other person
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20131128/6c5134a7/attachment.html>


More information about the Freeradius-Users mailing list