Software /
code /
prosody
Changeset
1600:cd9790f42269
ejabberdsql2prosody: Display a warning if a row has more columns than expected
author | Waqas Hussain <waqas20@gmail.com> |
---|---|
date | Sun, 26 Jul 2009 18:05:05 +0500 |
parents | 1599:308986a3e66a |
children | 1601:a3ffc27b6207 |
files | tools/ejabberdsql2prosody.lua |
diffstat | 1 files changed, 5 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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