version 0.3.27
[fms.git] / src / dbmaintenancethread.cpp
index 0ecfeda..ae4dc88 100644 (file)
@@ -104,6 +104,9 @@ void DBMaintenanceThread::Do10MinuteMaintenance()
                st.Step();\r
        }\r
 \r
+       // delete threads that have no messages\r
+       m_db->Execute("DELETE FROM tblThread WHERE ThreadID IN (SELECT tblThread.ThreadID FROM tblThread LEFT JOIN tblThreadPost ON tblThread.ThreadID=tblThreadPost.ThreadID WHERE tblThreadPost.ThreadID IS NULL);");\r
+\r
        // TODO - remove after corruption issue fixed\r
        if(ll=="8")\r
        {\r