select 123456 from radacct where username = 'mauro' LIMIT 1<br><br><div class="gmail_quote">On Wed, May 20, 2009 at 2:44 PM, Mauro Iorio - Smart Soft s.r.l. <span dir="ltr"><<a href="mailto:m.iorio@smartsoft.it">m.iorio@smartsoft.it</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">><br>
> What happens when you replace that SELECT statement with a hard-coded<br>
> number, like 123456? Does it still truncate the result?<br>
><br>
> Alan DeKok.<br>
><br>
<br>
Yes, it does. Check the following output:<br>
<br>
-----------------------------------------<br>
<br>
rlm_sqlcounter: Entering module authorize code<br>
sqlcounter_expand: 'SELECT 123456 FROM radacct WHERE<br>
UserName='%{User-Name}''<br>
[sessioncounter] expand: SELECT 123456 FROM radacct WHERE<br>
UserName='%{Use<br>
r-Name}' -> SELECT 123456 FROM radacct WHERE UserName='mauro'<br>
sqlcounter_expand: '%{sql:SELECT 123456 FROM radacct WHERE<br>
UserName='mauro'}'<br>
[sessioncounter] sql_xlat<br>
[sessioncounter] expand: %{User-Name} -> mauro<br>
[sessioncounter] sql_set_user escaped user --> 'mauro'<br>
[sessioncounter] expand: SELECT 123456 FROM radacct WHERE<br>
UserName='mauro<br>
' -> SELECT 123456 FROM radacct WHERE UserName='mauro'<br>
[sessioncounter] expand: /usr/var/log/radius/sqltrace.sql -><br>
/usr/var/log<br>
/radius/sqltrace.sql<br>
rlm_sql (sql): Reserving sql socket id: 3<br>
query: SELECT 123456 FROM radacct WHERE UserName='mauro'<br>
[sessioncounter] sql_xlat finished<br>
rlm_sql (sql): Released sql socket id: 3<br>
[sessioncounter] expand: %{sql:SELECT 123456 FROM radacct WHERE<br>
UserName=<br>
'mauro'} -> 1234<br>
rlm_sqlcounter: Check item is greater than query result<br>
rlm_sqlcounter: Authorized user mauro, check_item=3600, counter=1234<br>
rlm_sqlcounter: Sent Reply-Item for user mauro, Type=Session-Timeout,<br>
value=2366<br>
++[sessioncounter] returns ok<br>
WARNING: Please update your configuration, and remove 'Auth-Type = Local'<br>
WARNING: Use the PAP or CHAP modules instead.<br>
User-Password in the request is correct.<br>
+- entering group post-auth {...}<br>
++[exec] returns noop<br>
Sending Access-Accept of id 213 to 192.168.4.203 port 44967<br>
Session-Timeout = 2366<br>
Finished request 0.<br>
<br>
-----------------------------------------<br>
<br>
But when I use isql or tsql tools and runs the same query I get (since I<br>
have 12 records in radacct):<br>
<br>
SQL> select 123456 from radacct where username = 'mauro'<br>
+------------+<br>
| |<br>
+------------+<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
| 123456 |<br>
+------------+<br>
SQLRowCount returns 12<br>
12 rows fetched<br>
<br>
So I think everything about unixodbc drivers is working properly.<br>
<br>
Mauro Iorio.<br>
<br>
-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br>
</blockquote></div><br>