# HG changeset patch # User Kim Alvefur # Date 1390070013 -3600 # Node ID 98ed9fe368ac430ca275516e259f5edf463a181a # Parent c68e2b11d69146858747ffc71d30a61a4a2843cc mod_storage_sql2: Fix SQL syntax diff -r c68e2b11d691 -r 98ed9fe368ac plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Sat Jan 18 18:28:50 2014 +0100 +++ b/plugins/mod_storage_sql2.lua Sat Jan 18 19:33:33 2014 +0100 @@ -263,12 +263,12 @@ local args_len = #args -- Before or after specific item, exclusive if query.after then -- keys better be unique! - where[#where+1] = "`sort_id` > (SELECT `sort_id` FROM `prosodyarchive` WHERE `key` = ? AND `host` = ?` AND user` = ?` AND store` = ? LIMIT 1)" + where[#where+1] = "`sort_id` > (SELECT `sort_id` FROM `prosodyarchive` WHERE `key` = ? AND `host` = ? AND `user` = ? AND `store` = ? LIMIT 1)" args[args_len+1], args[args_len+2], args[args_len+3], args[args_len+4] = query.after, args[1], args[2], args[3]; args_len = args_len + 4 end if query.before then - where[#where+1] = "`sort_id` < (SELECT `sort_id` FROM `prosodyarchive` WHERE `key` = ? AND `host` = ?` AND user` = ?` AND store` = ? LIMIT 1)" + where[#where+1] = "`sort_id` < (SELECT `sort_id` FROM `prosodyarchive` WHERE `key` = ? AND `host` = ? AND `user` = ? AND `store` = ? LIMIT 1)" args[args_len+1], args[args_len+2], args[args_len+3], args[args_len+4] = query.before, args[1], args[2], args[3]; end end