[wp-trac] [WordPress Trac] #34660: Query breaks when nopaging = false and posts_per_page = -1

WordPress Trac noreply at wordpress.org
Wed Nov 11 20:37:20 UTC 2015


#34660: Query breaks when nopaging = false and posts_per_page = -1
-------------------------------------------------+-------------------------
 Reporter:  mgibbs189                            |       Owner:
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  Future
Component:  Query                                |  Release
 Severity:  normal                               |     Version:  trunk
 Keywords:  has-patch needs-docs needs-unit-     |  Resolution:
  tests                                          |     Focuses:
-------------------------------------------------+-------------------------

Comment (by mgibbs189):

 > You might also say that when `nopaging=true`, `posts_per_page` should be
 ignored.

 @boonebgorges I appreciate the response, but that's an entirely separate
 issue.

 This ticket addresses the specific case when `posts_per_page = -1` and
 `nopaging = false`. In this scenario, `nopaging` '''must''' be ignored to
 prevent an SQL error.

 This is because -1 isn't a valid SQL limit, and forcing `nopaging = true`
 is the only way to bypass the LIMIT clause. Know what I mean?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34660#comment:5>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list