From a831e5d3069dab75c7c8ef9dbf72af904bb0af09 Mon Sep 17 00:00:00 2001 From: Cronus89 Date: Sun, 3 Nov 2013 21:41:01 -0600 Subject: [PATCH] CREATE EVENT chanstats_event_cleanup_weekly failed due to calculating improper start of week. --- modules/stats/m_chanstats.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/stats/m_chanstats.cpp b/modules/stats/m_chanstats.cpp index 98d876222..ab67e311b 100644 --- a/modules/stats/m_chanstats.cpp +++ b/modules/stats/m_chanstats.cpp @@ -439,7 +439,7 @@ class MChanstats : public Module this->RunQuery(query); } query = "CREATE EVENT `chanstats_event_cleanup_weekly` " - "ON SCHEDULE EVERY 1 WEEK STARTS (DATE(CURRENT_TIMESTAMP)-WEEKDAY(CURRENT_TIMESTAMP)) " + "ON SCHEDULE EVERY 1 WEEK STARTS ADDDATE(CURDATE(), INTERVAL 1-DAYOFWEEK(CURDATE()) DAY) " "DO UPDATE `" + prefix + "chanstats` SET letters=0, words=0, line=0, actions=0, smileys_happy=0," "smileys_sad=0, smileys_other=0, kicks=0, modes=0, topics=0, time0=0, time1=0, time2=0," "time3=0, time4=0, time5=0, time6=0, time7=0, time8=0, time9=0, time10=0, time11=0,"