Multi Site and Custom Permalinks

WPMU 2.8.6 , subdirectory installation.

When having a blog with custom permalinks on and then switching it to all the posts will break with 404 errors.

Logging into the blog backend , going into the Permalinks menu and clicking update will resolve the issue. The issue will reappear if the blog is switched back to .

Looking deep at the code, something seems to be going wrong with the match rules before the sql query.

Ideas on this being a plugin issue or WPMU bug?

-Jason Potkanski