[wp-trac] [WordPress Trac] #14426: unneeded "SELECT FOUND_ROWS()" when no posts are found

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 2 22:43:47 UTC 2012


#14426: unneeded "SELECT FOUND_ROWS()" when no posts are found
-------------------------+-----------------------
 Reporter:  mark-k       |       Owner:
     Type:  enhancement  |      Status:  reopened
 Priority:  normal       |   Milestone:  3.5
Component:  Query        |     Version:  3.0
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+-----------------------
Changes (by nacin):

 * component:  Optimization => Query
 * milestone:  Future Release => 3.5


Comment:

 set_found_posts() should check if ( $this->posts ), and otherwise set 0
 for found_posts and max_num_pages. We shouldn't need to do
 `$this->found_posts = $this->max_num_pages = 0;` manually.

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


More information about the wp-trac mailing list