From 0a88d03dc980cbf3a59fed437388d9b33567d30b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Chmielowski?= Date: Wed, 18 Mar 2020 14:02:21 +0100 Subject: [PATCH] Use correct type for seconds field in mod_last sql queries --- src/mod_last_sql.erl | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mod_last_sql.erl b/src/mod_last_sql.erl index 0e8c39f8b..095cf001a 100644 --- a/src/mod_last_sql.erl +++ b/src/mod_last_sql.erl @@ -55,10 +55,11 @@ get_last(LUser, LServer) -> end. store_last_info(LUser, LServer, TimeStamp, Status) -> + TS = integer_to_binary(TimeStamp), case ?SQL_UPSERT(LServer, "last", ["!username=%(LUser)s", "!server_host=%(LServer)s", - "seconds=%(TimeStamp)d", + "seconds=%(TS)s", "state=%(Status)s"]) of ok -> ok; @@ -76,11 +77,12 @@ export(_Server) -> fun(Host, #last_activity{us = {LUser, LServer}, timestamp = TimeStamp, status = Status}) when LServer == Host -> + TS = integer_to_binary(TimeStamp), [?SQL("delete from last where username=%(LUser)s and %(LServer)H;"), ?SQL_INSERT("last", ["username=%(LUser)s", "server_host=%(LServer)s", - "seconds=%(TimeStamp)d", + "seconds=%(TS)s", "state=%(Status)s"])]; (_Host, _R) -> []