From: Alan T. DeKok Date: Tue, 8 Dec 2009 13:00:53 +0000 (+0100) Subject: Handle case where Acct-Session-Time might not exist X-Git-Tag: release_2_1_8~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b83d074c9b7657f72266bcb10e7fa897211c79f;p=thirdparty%2Ffreeradius-server.git Handle case where Acct-Session-Time might not exist --- diff --git a/raddb/sql/postgresql/dialup.conf b/raddb/sql/postgresql/dialup.conf index 144d7f8c5d2..7feef848074 100644 --- a/raddb/sql/postgresql/dialup.conf +++ b/raddb/sql/postgresql/dialup.conf @@ -226,7 +226,8 @@ accounting_stop_query = "UPDATE ${acct_table2} \ SET AcctStopTime = ('%S'::timestamp - '%{%{Acct-Delay-Time}:-0}'::interval), \ AcctSessionTime = CASE WHEN '%{Acct-Session-Time}' = '' THEN \ (EXTRACT(EPOCH FROM ('%S'::TIMESTAMP WITH TIME ZONE - AcctStartTime::TIMESTAMP WITH TIME ZONE \ - - '%{%{Acct-Delay-Time}:-0}'::INTERVAL)))::BIGINT ELSE '%{Acct-Session-Time}' END, \ + - '%{%{Acct-Delay-Time}:-0}'::INTERVAL)))::BIGINT \ + ELSE NULLIF('%{Acct-Session-Time}','')::BIGINT END, \ AcctInputOctets = (('%{%{Acct-Input-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Input-Octets}:-0}'::bigint), \ AcctOutputOctets = (('%{%{Acct-Output-Gigawords}:-0}'::bigint << 32) + '%{%{Acct-Output-Octets}:-0}'::bigint), \ AcctTerminateCause = '%{Acct-Terminate-Cause}', \