# HG changeset patch # User Waqas Hussain # Date 1328382613 -18000 # Node ID 11983a1e92c0a12d44f9a125ff8284f905b6857a # Parent c0f5c78cb8177bfa98e482ae197acd6e0319da62 tools/ejabberdsql2prosody: Handle INSERT statement form where column list is specified (by skipping the column list). diff -r c0f5c78cb817 -r 11983a1e92c0 tools/ejabberdsql2prosody.lua --- 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;