This patch limits DELETE to up to 30000 rows. It is need when PHPBB starts complaining about too_short max_allowed_packet (rising it up may also be partial solution).