Software /
code /
prosody
Diff
plugins/mod_storage_sql2.lua @ 6068:175590cc7b07
Merge 0.10->trunk
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Thu, 10 Apr 2014 13:16:54 +0200 |
parent | 6060:de4c83feb064 |
child | 6165:6a184b16b717 |
line wrap: on
line diff
--- a/plugins/mod_storage_sql2.lua Thu Apr 03 23:54:58 2014 +0200 +++ b/plugins/mod_storage_sql2.lua Thu Apr 10 13:16:54 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];