Ticket #3091 (closed defect: fixed)

Opened 2 years ago

Last modified 2 years ago

_max_num_pages can create ambiguities (and thereby db errors)

Reported by: filosofo Assigned to: anonymous
Priority: normal Milestone: 2.1
Component: Administration Version: 2.1
Severity: normal Keywords: bg|has-patch _max_num_pages db
Cc:

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

link-template.php.diff (0.7 kB) - added by filosofo on 09/01/06 08:52:12.

Change History

09/01/06 08:52:12 changed by filosofo

  • attachment link-template.php.diff added.

09/01/06 18:51:00 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

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