projects
/
prosody.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
19da869
)
mod_storage_sql2: Build counter query without ORDER BY clause
author
Kim Alvefur
<zash@zash.se>
Tue, 8 Apr 2014 17:23:11 +0000
(19:23 +0200)
committer
Kim Alvefur
<zash@zash.se>
Tue, 8 Apr 2014 17:23:11 +0000
(19:23 +0200)
plugins/mod_storage_sql2.lua
patch
|
blob
|
history
diff --git
a/plugins/mod_storage_sql2.lua
b/plugins/mod_storage_sql2.lua
index 7a2ec4a76e9fa307eec850adab21ee921f35220b..7414e5ed155ad256a24b4bb755062b189b9bc0ba 100644
(file)
--- 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];