tools/ejabberdsql2prosody: Handle INSERT statement form where column list is specified (by skipping the column list).
--- a/tools/ejabberdsql2prosody.lua Sun Feb 05 00:06:20 2012 +0500
+++ b/tools/ejabberdsql2prosody.lua Sun Feb 05 00:10:13 2012 +0500
@@ -129,7 +129,12 @@
end
end
local tname = readTableName();
- for ch in ("` VALUES "):gmatch(".") do read(ch); end -- expect this
+ read("`"); read(" ") -- expect this
+ if peek() == "(" then -- skip column list
+ repeat until read() == ")";
+ read(" ");
+ end
+ for ch in ("VALUES "):gmatch(".") do read(ch); end -- expect this
local tuples = readTuples();
read(";"); read("\n");
return tname, tuples;