]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
SQLite doesn't have GREATEST - use MAX instead
authorNick Porter <nick@portercomputing.co.uk>
Wed, 14 Feb 2024 14:28:55 +0000 (14:28 +0000)
committerNick Porter <nick@portercomputing.co.uk>
Wed, 14 Feb 2024 14:28:55 +0000 (14:28 +0000)
raddb/mods-config/sql/counter/sqlite/dailycounter.conf
raddb/mods-config/sql/counter/sqlite/expire_on_login.conf
raddb/mods-config/sql/counter/sqlite/monthlycounter.conf
raddb/mods-config/sql/counter/sqlite/weeklycounter.conf

index 9a2ec385e24f4f34ac58c99ce9924fb13e1c2395..b95afdf627834c61cfbbbed4608a1a0477da9fcf 100644 (file)
@@ -5,7 +5,7 @@
 #  below
 #
 query = "\
-       SELECT SUM(acctsessiontime - GREATEST((%%b - strftime('%%s', acctstarttime)), 0)) \
+       SELECT SUM(acctsessiontime - MAX((%%b - strftime('%%s', acctstarttime)), 0)) \
        FROM radacct \
        WHERE username = '%{${key}}' \
        AND (strftime('%%s', acctstarttime) + acctsessiontime) > %%b"
index f4e95a58881dcad20a50d6d7563c10414830b527..6c1c0860f9915fc8664f1ac823858992e32071df 100644 (file)
@@ -1,5 +1,5 @@
 query = "\
-       SELECT GREATEST(strftime('%%s', NOW()) - strftime('%%s', acctstarttime), 0) AS expires \
+       SELECT MAX(strftime('%%s', NOW()) - strftime('%%s', acctstarttime), 0) AS expires \
        FROM radacct \
        WHERE username = '%{${key}}' \
        ORDER BY acctstarttime \
index 5262097e329587130ee53d35c4de026bedc1ba36..3f5d427a264e5fe76efe528913c3d99f5845fe90 100644 (file)
@@ -5,7 +5,7 @@
 #  below
 #
 query = "\
-       SELECT SUM(acctsessiontime - GREATEST((%%b - strftime('%%s', acctstarttime)), 0)) \
+       SELECT SUM(acctsessiontime - MAX((%%b - strftime('%%s', acctstarttime)), 0)) \
        FROM radacct \
        WHERE username = '%{${key}}' AND \
        (strftime('%%s', acctstarttime) + acctsessiontime) > %%b"
index 06ce3b6089fb1c73e81977a6081094069d4f1292..90a8566643206364942f61f7d93d7b30ad059513 100644 (file)
@@ -5,7 +5,7 @@
 #  below
 #
 query = "\
-       SELECT SUM(acctsessiontime - GREATEST((%%b - strftime('%%s', acctstarttime)), 0)) \
+       SELECT SUM(acctsessiontime - MAX((%%b - strftime('%%s', acctstarttime)), 0)) \
        FROM radacct \
        WHERE username = '%{${key}}' \
        AND (strftime('%%s', acctstarttime) + acctsessiontime) > %%b"