aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2023-07-17 04:52:50 +0200
committerKim Alvefur <zash@zash.se>2023-07-17 04:52:50 +0200
commite1b3be001563903640f869a93392fd452aa9fb16 (patch)
tree1f3b8c99250ce3ab87d69d778bf5e9b5359b662e /plugins
parenta9eddf59a5d0eaf36fe96d73282d77285aff8eb4 (diff)
downloadprosody-e1b3be001563903640f869a93392fd452aa9fb16.tar.gz
prosody-e1b3be001563903640f869a93392fd452aa9fb16.zip
mod_storage_sql: Allow higher precision timestamps in SQLite3
Since it doesn't actually do strict typing :)
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_storage_sql.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 3768b6b2..fe7d2ef0 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -335,7 +335,11 @@ function archive_store:append(username, key, value, when, with)
end
-- FIXME update the schema to allow precision timestamps
- when = when and math.floor(when) or os.time();
+ when = when or os.time();
+ if engine.params.driver ~= "SQLite3" then
+ -- SQLite3 doesn't enforce types :)
+ when = math.floor(when);
+ end
with = with or "";
local ok, ret = engine:transaction(function()
local delete_sql = [[