[wp-hackers] LEFT JOIN in 2.7 to JOIN in 2.8; Why?

Mike Schinkel mikeschinkel at newclarity.net
Wed Jun 17 01:33:08 GMT 2009


Does anyone know why the change was made in 2.8 on line 2141 of /wp-includes/query.php to this: 

$join .= " JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) "; 

When in 2.7 on line 2136 of /wp-includes/query.php it was this? 

$join .= " LEFT JOIN $wpdb->postmeta ON ($wpdb->posts.ID = $wpdb->postmeta.post_id) "; 

I found it because it broke a plugin of mine where I was testing for 'LEFT JOIN ...' in the 'posts_join_paged' hook. 

I was able to fix my plugin by removing "LEFT " but I'm wondering: 

1.) Why was it changed in the first place? Was there a good reason that's non-obvious to me? If not it might break other's plugins for no good reason. 

2.) If no good reason can it be changed back? Testing for "LEFT JOIN ..." is more exact than testing or "JOIN ..."; or example there is a tiny chance I could match a "RIGHT JOIN ... " when I didn't intend to but not if I'm testing explicitly for "LEFT JOIN ..." 

Thanks in advance. 

-Mike Schinkel 
Custom Wordpress Plugins 

More information about the wp-hackers mailing list