]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Fix converting of learn count from sqlite to redis
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 28 Nov 2016 15:01:43 +0000 (15:01 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 28 Nov 2016 15:02:04 +0000 (15:02 +0000)
src/rspamadm/stat_convert.lua

index 5c880d7c5915147fbafd4448cd1936050d606b54..7b6de9836da009ff5ef22177102c3b5e427e4327 100644 (file)
@@ -146,11 +146,11 @@ return function (_, res)
   end
 
   -- Workaround for old databases
-  for row in db:rows('SELECT * FROM languages WHERE id=0;') do
-    if learns[row.id] then
-      learns[row.id] = learns[row.id] + row.learns
+  for row in db:rows('SELECT * FROM languages') do
+    if learns['0'] then
+      learns['0'] = learns['0'] + row.learns
     else
-      learns[row.id] = row.learns
+      learns['0'] = row.learns
     end
   end