Make WordPress Core

Opened 11 years ago

Closed 11 years ago

#32081 closed defect (bug) (fixed)

comments query w/ meta_value and comments__in returns clause is ambiguous db error

Reported by: willgladstone Owned by: boonebgorges
Priority: normal Milestone: 4.3
Component: Comments Version: 4.1.2
Severity: normal Keywords: has-patch needs-unit-tests
Cc: Focuses:

Description

using comments__in in a comment query does not work when also querying the comment meta table as the column name becomes ambiguous. Appending the db table name to the column name will fix it.

Attachments (1)

comment.diff (975 bytes ) - added by willgladstone 11 years ago.
Patch

Download all attachments as: .zip

Change History (4)

@willgladstone
11 years ago

Patch

#1 @boonebgorges
11 years ago

  • Keywords has-patch needs-unit-tests added
  • Milestone Awaiting Review4.3

Thanks for the report, and good call.

#2 @obenland
11 years ago

  • Owner set to boonebgorges
  • Status newassigned

#3 @boonebgorges
11 years ago

  • Resolutionfixed
  • Status assignedclosed

In 32461:

Use table prefix for comment__in and comment__not_in SQL clauses of WP_Comment_Query.

The prefix prevents ambiguity when joining against other tables.

Props willgladstone.
Fixes #32081.

Note: See TracTickets for help on using tickets.