aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql2.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2014-04-08 19:23:11 +0200
committerKim Alvefur <zash@zash.se>2014-04-08 19:23:11 +0200
commitafd077b62f4e9f4cd08c72ee164155a29d3f0b50 (patch)
treef85b3363dbb4d925b2a80eb05a0976366d05b441 /plugins/mod_storage_sql2.lua
parent548ee2aa2b7df77d898c0058d0afa4e3fda6d5fb (diff)
downloadprosody-afd077b62f4e9f4cd08c72ee164155a29d3f0b50.tar.gz
prosody-afd077b62f4e9f4cd08c72ee164155a29d3f0b50.zip
mod_storage_sql2: Build counter query without ORDER BY clause
Diffstat (limited to 'plugins/mod_storage_sql2.lua')
-rw-r--r--plugins/mod_storage_sql2.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua
index 7a2ec4a7..7414e5ed 100644
--- a/plugins/mod_storage_sql2.lua
+++ b/plugins/mod_storage_sql2.lua
@@ -289,7 +289,7 @@ function archive_store:find(username, query)
-- Total matching
if query.total then
- local stats = engine:select(sql_query:gsub("^(SELECT).-(FROM)", "%1 COUNT(*) %2"):format(t_concat(where, " AND "), "DESC", ""), unpack(args));
+ local stats = engine:select("SELECT COUNT(*) FROM `prosodyarchive` WHERE " .. t_concat(where, " AND "), unpack(args));
if stats then
local _total = stats()
total = _total and _total[1];