Hello Edi,<br> Enclosing sql statement inside empty if gives same error:<br><br>if(User-Name){<br> if("%{sql: UPDATE radacct set AcctStopTime=ADDDATE(AcctStartTime,INTERVAL AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session' WHERE UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}' and AcctStopTime is NULL}"){<br>
}<br>}<br>Sat Jan 15 07:43:33 2011 : Auth: Login OK: [test] (from client nagios port 0)<br>Sat Jan 15 07:44:47 2011 : Error: rlm_sql_mysql: MYSQL Error: No Fields<br>Sat Jan 15 07:44:47 2011 : Error: rlm_sql_mysql: MYSQL error: <br>
Sat Jan 15 07:44:47 2011 : Info: rlm_sql_mysql: Starting connect to MySQL server for #3<br>Sat Jan 15 07:44:47 2011 : Error: rlm_sql (sql): failed after re-connect<br><br><br><div class="gmail_quote">On Fri, Jan 14, 2011 at 6:19 PM, Eddie Stassen <span dir="ltr"><<a href="mailto:estassen@gmail.com">estassen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="im">On Fri, Jan 14, 2011 at 1:57 PM, Johan Meiring<br>
<<a href="mailto:jmeiring@pcservices.co.za">jmeiring@pcservices.co.za</a>> wrote:<br>
> On 2011/01/14 12:50 PM, Bishal Pun wrote:<br>
>><br>
>> Alan,<br>
>><br>
>> While running that command in mysql it clear the session of user. But<br>
>> with<br>
>> radius unlang it is giving error in radius log.<br>
>><br>
><br>
> I might be wrong, but as far as I know rlm_mysql expects something to come<br>
> back from the query.<br>
><br>
> Can't think of a solution though unless rlm_mysql will allow somehting like<br>
><br>
> "%{sql: SELECT 1; UPDATE radacct set<br>
> AcctStopTime=ADDDATE(AcctStartTime,INTERVAL<br>
> AcctSessionTime SECOND), AcctTerminateCause='Clear-Stale Session' WHERE<br>
> UserName='%{User-Name}' and CallingStationId='%{Calling-Station-Id}' and<br>
> AcctStopTime is null}"<br>
><br>
> --<br>
<br>
</div>Enclosing the UPDATE in an empty 'if' works:<br>
<br>
if ("%{sql: UPDATE ...}") {<br>
}<br>
<br>
That prevents the rlm_sql_mysql module from looking for returned fields.<br>
<font color="#888888"><br>
Eddie<br>
</font><div><div></div><div class="h5"><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>
</div></div></blockquote></div><br><div style="visibility: hidden; display: inline;" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style>