We've had some problems with the pruning in the two (out of the 19 forums we have) forums we're using pruning in. We got error messages like this:
Could not obtain list of posts to prune
SQL Error : 2006 MySQL server has gone away
SELECT post_id FROM phpbb_posts WHERE forum_id = 24 AND topic_id IN (21154, 21154, 21154, 21154, 21154, ............, 21154)
Line : 69
File : /usr/home/64bits/www/forum/includes/prune.php
It repeats '21154' 171686 times.
Well, we didn't know what to do about it so we simply disabled autopruning. For a while that was ok, but the forum became a bit to big, so we thought that we should delete the two forums (and their content) and create two new ones.
One of them was no problem to delete, but the other was a bit messy. We couldn't figure it out, so I asked in #phpbb on freenet, and a friendly op tried to help me. He told me to delete every (visible) topic in the forum. It didn't solve the problem, and strangely enough the index.php-page listed about 25 topics in the forum, even if the viewforum.php-page listed none. Synchronizing the forum from the admin panel didn't work. He got admin in our forum, and tried a few things (while I translated swedish to english for him ). But he couldn't solve it. So I was asked to post the problem here instead.
It's been a couple of days since then, but since we've just hidden the forum with the problem it's not been critical.
The problem came with one of the new forums today, with the error message above. So I did a little research, and found out that the topic with the ID of 21154 had '0' as topic_first_post_id and topic_last_post_id. So I searched for all topics with 0 as topic_first/last_post_id, and came up with 169 others. Some (15 or so) belonged to the forum we couldn't delete, and the others belonged to other forums without autopruning enabled. Some of them was new, like a couple of hours old, but they didnt show up in the respective forums index (although a copy of the thread was visible, with the same title, but another ID). I made a backup of the database and deleted every row from phpbb_topics where topic_first_post_id and topic_last_post_id was 0. Index.php still reported our troublesome forum to have 10 (or so) topics left, but now I was finally able to delete the forum.
So my question now is how I can prevent the forum from creating topics with topic_first/last_post_id of 0?
Sorry for any bad english and I appreciate any help I can get.
Edit: Strange.. now after I've deleted the rows in phpbb_topics with topic_first/last_post_id = 0, at least one of the rows were recreated (same topicID), with the same data as the orginal, but this time it had non-zero values in the two fields.