<html><head><base href="x-msg://1418/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On 22 Jul 2012, at 11:56, Amir Tal wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div lang="EN-US" link="blue" vlink="purple"><div class="WordSection1" style="page: WordSection1; "><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">Adding unique key to the database results in the following being returned from rlm_sql,<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">What happen to accounting data when a duplicate entry is encountered?<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">In addition, currently there is no scheduled clearing of the data in radacct table, wont this increase in occurrence?<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; "><o:p> </o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">--<span lang="HE" dir="RTL" style="font-family: Arial, sans-serif; "><o:p></o:p></span></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; "><span dir="LTR"></span><span dir="LTR"></span>[sql] expand: %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}} -> shimoni<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] sql_set_user escaped user --> 'shimoni'<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: %{Acct-Input-Gigawords} -> 0<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: %{Acct-Input-Octets} -> 0<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: %{Acct-Output-Gigawords} -> 0<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: %{Acct-Output-Octets} -> 0<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: %{Acct-Delay-Time} -> 12<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: UPDATE radacct SET acctstoptime = '%S', acctsessiontime = '%{Acct-Session-Time}', acctinputoctets = '%{%{Acct-Input-Gigawords}:-0}' << 32 | '%{%{Acct-Input-Octets}:-0}', acctoutputoctets = '%{%{Acct-Output-Gigawords}:-0}' << 32 | '%{%{Acct-Output-Octets}:-0}', acctterminatecause = '%{Acct-Terminate-Cause}', acctstopdelay = '%{%{Acct-Delay-Time}:-0}', connectinfo_stop = '%{Connect-Info}' WHERE acctsessionid = '%{Acct-Session-Id}' AND username = '%{SQL-User-Name}' AND nasipaddress = '%{NAS-IP-Address}' -> UPDATE radacct SET acctstoptime = '2012-07-22 02:03:28', acctsessiontime = '0', acctinputoctets = '0' << 32 | '0', acctoutputoctets = '0' << 32 | '0', acctterminatecause = 'User-Error', acctstopdelay = '12', connectinfo_stop = '' WHERE acctsessionid = 'erx ip:109.226.0.9:172.29.81.67:3280:96f8:1aa8:87fb:4d2:0062712021' AND username = 'shimoni' AND nasipaddress = '109.226.1.12'<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] expand: /var/log/radius/sqltrace.sql -> /var/log/radius/sqltrace.sql<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">rlm_sql_mysql: MYSQL check_error: 1062 received<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">[sql] Couldn't insert SQL accounting STOP record - Duplicate entry 'c6d3d253355b3dcf' for key 2<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">rlm_sql_mysql: MYSQL check_error: 1062 received<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">rlm_sql_mysql: Cannot store result<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">rlm_sql_mysql: MySQL error 'Duplicate entry 'c6d3d253355b3dcf' for key 2'<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">rlm_sql (sql): Released sql socket id: 11<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">++[sql] returns fail<o:p></o:p></div><div style="margin-top: 0cm; margin-right: 0cm; margin-left: 0cm; margin-bottom: 0.0001pt; text-align: left; direction: ltr; unicode-bidi: embed; font-size: 11pt; font-family: Calibri, sans-serif; ">--</div></div></div></span></blockquote><br></div><div>Can you please build against the current v2.1.x HEAD; the debug output doesn't make sense when checking through the rlm_sql.c code. Could you also post your dialup.conf file.</div><div><br></div><div>-Arran</div></body></html>