diff options
author | Kim Alvefur <zash@zash.se> | 2022-09-07 12:27:12 +0200 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2022-09-07 12:27:12 +0200 |
commit | 1dd9e547ced3f6ce998b0e722dd4e4f9e69d5b07 (patch) | |
tree | 1d8a077fe63bed60a0846440659c5014936d2caf /plugins | |
parent | fd637bf6bede43756abd33ec84593b3091d1283d (diff) | |
download | prosody-1dd9e547ced3f6ce998b0e722dd4e4f9e69d5b07.tar.gz prosody-1dd9e547ced3f6ce998b0e722dd4e4f9e69d5b07.zip |
mod_storage_sql: Strip timestamp precision in queries to fix error (thanks muppeth)
Fixes
Error in SQL transaction: Error executing statement parameters: ERROR: invalid input syntax for integer
This was handled for INSERT in 9524bb7f3944 but not SELECT.
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_storage_sql.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index ca8b51ac..eb335d6b 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -355,12 +355,12 @@ end local function archive_where(query, args, where) -- Time range, inclusive if query.start then - args[#args+1] = query.start + args[#args+1] = math.floor(query.start); where[#where+1] = "\"when\" >= ?" end if query["end"] then - args[#args+1] = query["end"]; + args[#args+1] = math.floor(query["end"]); if query.start then where[#where] = "\"when\" BETWEEN ? AND ?" -- is this inclusive? else |