« Return to Thread: LEFT JOIN in 2.7 to JOIN in 2.8; Why?

Re: LEFT JOIN in 2.7 to JOIN in 2.8; Why?

by Mike Schinkel-5 :: Rate this Message:

Reply to Author | View in Thread

"Austin Matzko" <if.website@...> wrote:
> According to this ticket, it was done for better performance:
> http://core.trac.wordpress.org/ticket/9720

Thanks for finding that.  OTOH, it looks like Ryan reverted it anyway because of other regression bugs:

   http://core.trac.wordpress.org/ticket/9851

> You could use a negative lookbehind, which will match "LEFT JOIN" and "JOIN", but not "RIGHT JOIN":
> preg_match('/(?<!RIGHT )JOIN/', $text)

Thanks for that. I'm still not a regex whiz so unless it's obvious I don't think to use regex.
OTOH, isn't preg_match() significantly slower than strpos()?

Also, for future finders of this thread the follow is what you'd need in hook post_join_paged($join) - note the space after the closing paren, not before:

   preg_match('/(?<!RIGHT) JOIN/', $join)

-Mike Schinkel
Custom Wordpress Plugins
http://mikeschinkel.com/custom-wordpress-plugins
_______________________________________________
wp-hackers mailing list
wp-hackers@...
http://lists.automattic.com/mailman/listinfo/wp-hackers

 « Return to Thread: LEFT JOIN in 2.7 to JOIN in 2.8; Why?