Diff

plugins/mod_storage_sql2.lua @ 5985:98ed9fe368ac

mod_storage_sql2: Fix SQL syntax
author Kim Alvefur <zash@zash.se>
date Sat, 18 Jan 2014 19:33:33 +0100
parent 5979:4c41404d9eec
child 5995:aa7534a877fe
line wrap: on
line diff
--- 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