[wp-trac] Re: [WordPress Trac] #9167: query_posts('meta_key=foo') returns duplicate posts

WordPress Trac wp-trac at lists.automattic.com
Thu Feb 19 16:55:03 GMT 2009


#9167: query_posts('meta_key=foo') returns duplicate posts
--------------------------+-------------------------------------------------
 Reporter:  scribu        |       Owner:  anonymous
     Type:  defect (bug)  |      Status:  new      
 Priority:  normal        |   Milestone:  2.7.2    
Component:  General       |     Version:           
 Severity:  normal        |    Keywords:           
--------------------------+-------------------------------------------------

Comment(by filosofo):

 Good idea.  GROUP BY is pretty much synonymous with DISTINCT, and it seems
 to be WP's preferred way of making results distinct (the DISTINCT clause
 is never used in core Loop).  Attached patch groups by wp_posts.ID when
 meta_key is queried.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/9167#comment:10>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list