Changeset

5979:4c41404d9eec

mod_storage_sql2: Fix syntax error in subquery (Thanks Lance)
author Kim Alvefur <zash@zash.se>
date Sun, 05 Jan 2014 23:38:34 +0100
parents 5972:f365d3c8fd2c
children 5980:787df1130965
files plugins/mod_storage_sql2.lua
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_storage_sql2.lua	Mon Dec 30 23:49:23 2013 +0100
+++ b/plugins/mod_storage_sql2.lua	Sun Jan 05 23:38:34 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