Comparison

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
comparison
equal deleted inserted replaced
6059:0cbdf7243540 6068:175590cc7b07
287 287
288 archive_where(query, args, where); 288 archive_where(query, args, where);
289 289
290 -- Total matching 290 -- Total matching
291 if query.total then 291 if query.total then
292 local stats = engine:select(sql_query:gsub("^(SELECT).-(FROM)", "%1 COUNT(*) %2"):format(t_concat(where, " AND "), "DESC", ""), unpack(args)); 292 local stats = engine:select("SELECT COUNT(*) FROM `prosodyarchive` WHERE " .. t_concat(where, " AND "), unpack(args));
293 if stats then 293 if stats then
294 local _total = stats() 294 local _total = stats()
295 total = _total and _total[1]; 295 total = _total and _total[1];
296 end 296 end
297 if query.limit == 0 then -- Skip the real query 297 if query.limit == 0 then -- Skip the real query