summaryrefslogtreecommitdiffstats
path: root/raddb/mods-config/sql/main
diff options
context:
space:
mode:
Diffstat (limited to 'raddb/mods-config/sql/main')
-rw-r--r--raddb/mods-config/sql/main/mongo/queries.conf10
-rw-r--r--raddb/mods-config/sql/main/mssql/queries.conf2
-rw-r--r--raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql2
-rw-r--r--raddb/mods-config/sql/main/mysql/process-radacct.sql2
-rw-r--r--raddb/mods-config/sql/main/postgresql/queries.conf2
5 files changed, 9 insertions, 9 deletions
diff --git a/raddb/mods-config/sql/main/mongo/queries.conf b/raddb/mods-config/sql/main/mongo/queries.conf
index 732e1e8..a496932 100644
--- a/raddb/mods-config/sql/main/mongo/queries.conf
+++ b/raddb/mods-config/sql/main/mongo/queries.conf
@@ -91,7 +91,7 @@ authorize_check_query = "db.${authcheck_table}.aggregate([ \
'op': ':=' \
} \
} \
-])" \
+])"
# TBD: fill in things here
authorize_reply_query = ""
@@ -150,7 +150,7 @@ accounting {
}, \
'$push': { \
'events_data': { \
- 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}', \
+ 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}}}', \
'event_type': 'Accounting-Start', \
'event_time': '%{Packet-Original-Timestamp}', \
'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \
@@ -202,7 +202,7 @@ accounting {
}, \
'$push': { \
'events_data': { \
- 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}', \
+ 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}}}', \
'event_type': 'Accounting-Interim-Update', \
'event_time': '%{Packet-Original-Timestamp}', \
'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \
@@ -214,7 +214,7 @@ accounting {
'closed': false, \
'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \
} \
- },
+ }, \
'upsert': true \
})"
# End Interim-Update
@@ -235,7 +235,7 @@ accounting {
}, \
'$push': { \
'events_data': { \
- 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}', \
+ 'event_id': '%{sha256:%{tolower:%{Calling-Station-Id}}}', \
'event_type': 'Accounting-Stop', \
'event_time': '%{Packet-Original-Timestamp}', \
'creation_date': { '$date': { '$numberLong': '%{expr: (%l * 1000) + (%M / 1000)}' } } \
diff --git a/raddb/mods-config/sql/main/mssql/queries.conf b/raddb/mods-config/sql/main/mssql/queries.conf
index 1978463..d83a27d 100644
--- a/raddb/mods-config/sql/main/mssql/queries.conf
+++ b/raddb/mods-config/sql/main/mssql/queries.conf
@@ -373,7 +373,7 @@ accounting {
UPDATE ${....acct_table1} \
SET \
AcctStartTime = ${....event_timestamp}, \
- AcctUpdateTime = ${....event_timestamp }, \
+ AcctUpdateTime = ${....event_timestamp}, \
AcctStartDelay = '%{%{Acct-Delay-Time}:-0}', \
ConnectInfo_start = '%{Connect-Info}' \
WHERE AcctUniqueId = '%{Acct-Unique-Session-ID}' \
diff --git a/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql b/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql
index e32224a..bc2e7da 100644
--- a/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql
+++ b/raddb/mods-config/sql/main/mysql/extras/wimax/schema.sql
@@ -3,7 +3,7 @@
# which replaces the "radpostauth" table.
#
-CREATE TABLE wimax (
+CREATE TABLE IF NOT EXISTS wimax (
id int(11) NOT NULL auto_increment,
username varchar(64) NOT NULL default '',
authdate timestamp NOT NULL,
diff --git a/raddb/mods-config/sql/main/mysql/process-radacct.sql b/raddb/mods-config/sql/main/mysql/process-radacct.sql
index 8902338..0696603 100644
--- a/raddb/mods-config/sql/main/mysql/process-radacct.sql
+++ b/raddb/mods-config/sql/main/mysql/process-radacct.sql
@@ -45,7 +45,7 @@
-- +----------------+----------------+-----------------+
-- 7 rows in set (0.000 sec)
--
-CREATE TABLE data_usage_by_period (
+CREATE TABLE IF NOT EXISTS data_usage_by_period (
username VARCHAR(64),
period_start DATETIME,
period_end DATETIME,
diff --git a/raddb/mods-config/sql/main/postgresql/queries.conf b/raddb/mods-config/sql/main/postgresql/queries.conf
index 18a1ed0..80953e0 100644
--- a/raddb/mods-config/sql/main/postgresql/queries.conf
+++ b/raddb/mods-config/sql/main/postgresql/queries.conf
@@ -534,7 +534,7 @@ accounting {
'%{%{NAS-IPv6-Address}:-%{NAS-IP-Address}}', \
NULLIF('%{%{NAS-Port-ID}:-%{NAS-Port}}', ''), \
'%{NAS-Port-Type}', \
- ${....event_timestamp}, \
+ TO_TIMESTAMP(${....event_timestamp_epoch} - %{%{Acct-Session-Time}:-0}), \
${....event_timestamp}, \
NULL, \
%{%{Acct-Session-Time}:-NULL}, \