error in the queries.conf file

Pawel Bien pawel.bien at euron.pl
Fri Mar 20 13:18:29 CET 2015


I found an error in the file raddb/mods-config/sql/main/mysql/queries.conf (fr 3.0.7)
There is missing value for connectinfo_stop field in the SQL INSERT statement (after '%{Connect-Info}' in the line 380).
This cause an error:
rlm_sql_mysql: MySQL error 'Column count doesn't match value count at row 1'

accounting {
	(...)
	type {
		(...)
		stop {
			(...)
			#
			#  The update condition matched no existing sessions. Use
			#  the values provided in the update to create a new session.
			#
			query = "\
				INSERT INTO ${....acct_table2} \
					(${...column_list}) \
				VALUES \
					('%{Acct-Session-Id}', \
					'%{Acct-Unique-Session-Id}', \
					'%{SQL-User-Name}', \
					'%{Realm}', \
					'%{NAS-IP-Address}', \
					'%{NAS-Port}', \
					'%{NAS-Port-Type}', \
					FROM_UNIXTIME(%{integer:Event-Timestamp} - \
						%{%{Acct-Session-Time}:-0}), \
					FROM_UNIXTIME(%{integer:Event-Timestamp}), \
					FROM_UNIXTIME(%{integer:Event-Timestamp}), \
					'%{Acct-Session-Time}', \
					'%{Acct-Authentic}', '', \
					'%{Connect-Info}', \                    <-missing value after this
					'%{%{Acct-Input-Gigawords}:-0}' << 32 | \
						'%{%{Acct-Input-Octets}:-0}', \
					'%{%{Acct-Output-Gigawords}:-0}' << 32 | \
						'%{%{Acct-Output-Octets}:-0}', \
					'%{Called-Station-Id}', \
					'%{Calling-Station-Id}', \
					'%{Acct-Terminate-Cause}', \
					'%{Service-Type}', \
					'%{Framed-Protocol}', \
					'%{Framed-IP-Address}')"
		}
	}
}


Just add next line with 
'', \ 
after '%{Connect-Info}', \


The similar error is duplicated in queries.conf template for the other database types (mssql, oracle, sqlite) except postgresql.

Cheers,
Pawel Bien



More information about the Freeradius-Users mailing list