Max versus Current Revision
Contradiction thanks to moderated edits
Here's the situation. The current revision is defined as the most recent revision that has been approved. The "Next Revision" links when comparing or viewing revisions use the current revision value to determine when NOT to create a link.
Since a revision needing approval occurs after the current revision it would not be possible to reach that revision using the "Next revision" link.
In addition, if the revision ID is known, we could view the revision needing approval in these contexts. However, because it is not the current revision, a "Next revision" link would be present, even though no later revision exists.
To solve these issues, a distinction needs to be made between the MAX revision and the CURRENT revision. Also, the "Next revision" link would have to consider moderation/editor permissions when the MAX revision requires approval. Rather than pulling just a single record containing MIN and MAX values, we probably have to pull the whole table, and cycle through to get the MIN, MAX, and CURRENT values.