From 78e77077910d4fefa9ce4f60827765bd1157b755 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 17 Jul 2022 17:05:28 +0200 Subject: mod_http_files: Log warning about legacy modules using mod_http_files It is time. Most community modules should have been adjusted to work with the new (net.http.files) way. At some point this usage should be prevented. Related to #1765 --- plugins/mod_http_files.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_http_files.lua b/plugins/mod_http_files.lua index 69389b7f..b921116a 100644 --- a/plugins/mod_http_files.lua +++ b/plugins/mod_http_files.lua @@ -74,8 +74,7 @@ function serve(opts) if opts.index_files == nil then opts.index_files = dir_indices; end - -- TODO Crank up to warning - module:log("debug", "%s should be updated to use 'net.http.files' instead of mod_http_files", get_calling_module()); + module:log("warn", "%s should be updated to use 'net.http.files' instead of mod_http_files", get_calling_module()); return fileserver.serve(opts); end -- cgit v1.2.3 From 2dbbce23823edbf4261df92175d7ee9cf7cca3a9 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Fri, 22 Jul 2022 19:09:50 +0200 Subject: mod_storage_sql: Fix summary API with Postgres (fixes #1766) The ORDER BY and LIMIT clauses are not needed and don't even make much sense. This part was most likely a leftover from the :find method. Tested with sqlite and postgres 14 --- plugins/mod_storage_sql.lua | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua index 448eaa2d..f941025e 100644 --- a/plugins/mod_storage_sql.lua +++ b/plugins/mod_storage_sql.lua @@ -544,8 +544,7 @@ function archive_store:summary(username, query) SELECT DISTINCT "with", COUNT(*), MIN("when"), MAX("when") FROM "prosodyarchive" WHERE %s - GROUP BY "with" - ORDER BY "sort_id" %s%s; + GROUP BY "with"; ]]; local args = { host, user or "", store, }; local where = { "\"host\" = ?", "\"user\" = ?", "\"store\" = ?", }; @@ -558,8 +557,7 @@ function archive_store:summary(username, query) args[#args+1] = query.limit; end - sql_query = sql_query:format(t_concat(where, " AND "), query.reverse - and "DESC" or "ASC", query.limit and " LIMIT ?" or ""); + sql_query = sql_query:format(t_concat(where, " AND ")); return engine:select(sql_query, unpack(args)); end); if not ok then return ok, result end -- cgit v1.2.3