Diff

plugins/mod_storage_sql.lua @ 12600:3d3a0c4e2662

Merge 0.12->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 29 Jul 2022 17:10:31 +0200
parent 12595:0572b6e604a3
parent 12599:5aafcf6a0730
child 12631:9524bb7f3944
line wrap: on
line diff
--- a/plugins/mod_storage_sql.lua	Wed Jul 27 00:32:04 2022 +0200
+++ b/plugins/mod_storage_sql.lua	Fri Jul 29 17:10:31 2022 +0200
@@ -543,8 +543,7 @@
 		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\" = ?", };
@@ -557,8 +556,7 @@
 			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