_max_num_pages can create ambiguities (and thereby db errors)
|Reported by:||filosofo||Owned by:||anonymous|
|Severity:||normal||Keywords:||bg|has-patch _max_num_pages db|
By using this expression: "SELECT COUNT(DISTINCT ID)" the function _max_num_pages creates an ambiguity any time a db request has joined the users and posts tables, as both tables have ID fields.
(This could happen for example if you're trying to return posts based on a search of user names.)
Since the ID in _max_num_pages could not be used for any other field than that of ID in the posts table, there's no reason not to disambiguate it, as my patch does.