[wp-trac] [WordPress Trac] #14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
WordPress Trac
wp-trac at lists.automattic.com
Fri Oct 12 21:47:52 UTC 2012
#14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
-------------------------+-----------------------
Reporter: mark-k | Owner: ryan
Type: enhancement | Status: reopened
Priority: normal | Milestone: 3.5
Component: Query | Version: 3.0
Severity: normal | Resolution:
Keywords: has-patch |
-------------------------+-----------------------
Comment (by nacin):
Replying to [comment:18 ryan]:
> Or have the plugin call set_found_posts() itself. There's only so much
that can be done to retain back compat with a plugin that does such deep
voodoo.
Or we can type-check it. So, return if `$this->posts === array()` (or
`is_array( $this->posts ) && ! $this->posts`). That allows a null/false
for $this->posts to be considered as "hey, someone is doing some crazy
stuff here, let's not make too many assumptions."
--
Ticket URL: <http://core.trac.wordpress.org/ticket/14426#comment:19>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list