aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
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
commit4796c80dab04cb882c9d4a5bfa463846ade3f2ae (patch)
treef85b3363dbb4d925b2a80eb05a0976366d05b441 /plugins
parent438f9c427b2feae2e0e2809b21710346cd989d33 (diff)
downloadprosody-4796c80dab04cb882c9d4a5bfa463846ade3f2ae.tar.gz
prosody-4796c80dab04cb882c9d4a5bfa463846ade3f2ae.zip
mod_storage_sql2: Build counter query without ORDER BY clause
Diffstat (limited to 'plugins')
-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];