aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_storage_sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2021-01-13 15:33:44 +0100
committerKim Alvefur <zash@zash.se>2021-01-13 15:33:44 +0100
commite332c1741018a39eb3cd9df097d105539c2be071 (patch)
tree4ee7656199e7759026bc44aed3ef5fdee737780c /plugins/mod_storage_sql.lua
parent7b4c3318d8c2bcf19c386a3b3fc3f2fd319c9d7b (diff)
downloadprosody-e332c1741018a39eb3cd9df097d105539c2be071.tar.gz
prosody-e332c1741018a39eb3cd9df097d105539c2be071.zip
mod_storage_sql: Fix compatibilty with Lua 5.1
string.rep() doesn't have the 3rd argument before Lua 5.2 Revert once we drop support for Lua 5.1
Diffstat (limited to 'plugins/mod_storage_sql.lua')
-rw-r--r--plugins/mod_storage_sql.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/plugins/mod_storage_sql.lua b/plugins/mod_storage_sql.lua
index 9a7d2882..91b73eb4 100644
--- a/plugins/mod_storage_sql.lua
+++ b/plugins/mod_storage_sql.lua
@@ -381,7 +381,8 @@ local function archive_where(query, args, where)
-- Set of ids
if query.ids then
local nids, nargs = #query.ids, #args;
- where[#where + 1] = "\"key\" IN (" .. string.rep("?", nids, ",") .. ")";
+ -- COMPAT Lua 5.1: No separator argument to string.rep
+ where[#where + 1] = "\"key\" IN (" .. string.rep("?,", nids):sub(1,-2) .. ")";
for i, id in ipairs(query.ids) do
args[nargs+i] = id;
end