From MySQL 5.0."someversion" it became illegal to do
"DELETE FROM mdl_forum_posts USING mdl_forum_discussions fd, mdl_forum_posts fp, mdl_forum f WHERE fp.discussion=fd.id and f.course=1336 AND f.id=fd.forum" (the example is from function forum_delete_userdata)
It returns "Unknown table 'mdl_forum_posts' in MULTI DELETE".
Instead, use
"DELETE FROM fp USING mdl_forum_discussions fd, mdl_forum_posts fp, mdl_forum f WHERE fp.discussion=fd.id and f.course=1336 AND f.id=fd.forum"
This kind of make sense, even... though not very nice of MySQL to break these bits of Moodle. I think there are other instances as well. Maybe in 1.7 also. They don't usually show as errors in Moodle, stuff just doesn't get deleted.
From MySQL 5.0 manual:
" Note: If you provide an alias for a table, you must use the alias when referring to the table:
DELETE t1 FROM test AS t1, test2 WHERE ..."
(http://dev.mysql.com/doc/refman/5.0/en/delete.html)