WordPress.org

Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#3091 closed defect (bug) (fixed)

_max_num_pages can create ambiguities (and thereby db errors)

Reported by: filosofo Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.1
Component: Administration Keywords: bg|has-patch _max_num_pages db
Focuses: Cc:
PR Number:

Description

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.

Attachments (1)

link-template.php.diff (679 bytes) - added by filosofo 13 years ago.

Download all attachments as: .zip

Change History (2)

#1 @ryan
13 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [4155]) Resolve table ambiguity.Props filosofo. fixes #3091

Note: See TracTickets for help on using tickets.