# HG changeset patch # User Waqas Hussain # Date 1248613505 -18000 # Node ID cd9790f422693702d3cbd4b6fd382fc3fd090903 # Parent 308986a3e66a30044e2e7b497fef65bff77b1a1d ejabberdsql2prosody: Display a warning if a row has more columns than expected diff -r 308986a3e66a -r cd9790f42269 tools/ejabberdsql2prosody.lua --- a/tools/ejabberdsql2prosody.lua Sun Jul 26 17:51:36 2009 +0500 +++ b/tools/ejabberdsql2prosody.lua Sun Jul 26 18:05:05 2009 +0500 @@ -181,8 +181,11 @@ for i=1,#data do local row = data[i]; for j=1,#row do - row[m[j]] = row[j]; - row[j] = nil; + local n = m[j]; + if n then + row[n] = row[j]; + row[j] = nil; + else print("[warning] expected "..#n.." columns for table `"..name.."`, found "..#row); break; end end end end