# HG changeset patch # User Kim Alvefur # Date 1662546432 -7200 # Node ID 4cfd093439478f8fb01be05ae05fbe67685e8c78 # Parent cd993fd7b60d553a2be5246a87be560a1f8a1464 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. diff -r cd993fd7b60d -r 4cfd09343947 plugins/mod_storage_sql.lua --- a/plugins/mod_storage_sql.lua Sun Sep 04 10:01:57 2022 +0100 +++ b/plugins/mod_storage_sql.lua Wed Sep 07 12:27:12 2022 +0200 @@ -355,12 +355,12 @@ 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