Software /
code /
prosody
Changeset
6060:de4c83feb064
mod_storage_sql2: Build counter query without ORDER BY clause
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Tue, 08 Apr 2014 19:23:11 +0200 |
parents | 6058:1607b03356ed |
children | 6061:1056ea08970f |
files | plugins/mod_storage_sql2.lua |
diffstat | 1 files changed, 1 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_storage_sql2.lua Thu Apr 03 23:48:12 2014 +0200 +++ b/plugins/mod_storage_sql2.lua Tue Apr 08 19:23:11 2014 +0200 @@ -289,7 +289,7 @@ -- 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];