aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2015-09-02 18:55:35 +0100
committerMatthew Wild <mwild1@gmail.com>2015-09-02 18:55:35 +0100
commit95e9399b77a5b7e5520cc1187c267171d4c494b7 (patch)
tree75ae2e07fd0ffea8a7063e9fbc3e5dbd0108d619 /util
parent1b379adbc661947763a198ea2a3e114359fafe82 (diff)
parent388fa0cd28e4a9911f6d6504e15126071952a453 (diff)
downloadprosody-95e9399b77a5b7e5520cc1187c267171d4c494b7.tar.gz
prosody-95e9399b77a5b7e5520cc1187c267171d4c494b7.zip
Merge 0.10->trunk
Diffstat (limited to 'util')
-rw-r--r--util/hex.lua3
-rw-r--r--util/sql.lua2
2 files changed, 4 insertions, 1 deletions
diff --git a/util/hex.lua b/util/hex.lua
index e41f4863..4cc28d33 100644
--- a/util/hex.lua
+++ b/util/hex.lua
@@ -1,6 +1,7 @@
local s_char = string.char;
local s_format = string.format;
local s_gsub = string.gsub;
+local s_lower = string.lower;
local char_to_hex = {};
local hex_to_char = {};
@@ -19,7 +20,7 @@ local function to(s)
end
local function from(s)
- return (s_gsub(s, "..", hex_to_char));
+ return (s_gsub(s_lower(s), "%X*(%x%x)%X*", hex_to_char));
end
return { to = to, from = from }
diff --git a/util/sql.lua b/util/sql.lua
index 70e103df..2d5e1774 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -180,6 +180,7 @@ function engine:_transaction(func, ...)
--assert(not self.__transaction, "Recursive transactions not allowed");
local args, n_args = {...}, select("#", ...);
local function f() return func(unpack(args, 1, n_args)); end
+ log("debug", "SQL transaction begin [%s]", tostring(func));
self.__transaction = true;
local success, a, b, c = xpcall(f, debug_traceback);
self.__transaction = nil;
@@ -328,4 +329,5 @@ return {
Table = Table;
Index = Index;
create_engine = create_engine;
+ db2uri = db2uri;
};