[wp-trac] [WordPress Trac] #56991: Update to get_page_by_title in 6.1 changes WHERE clause

WordPress Trac noreply at wordpress.org
Mon Nov 7 00:27:22 UTC 2022


#56991: Update to get_page_by_title in 6.1 changes WHERE clause
--------------------------+---------------------
 Reporter:  Bjorn2404     |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  6.1.1
Component:  General       |     Version:  6.1
 Severity:  normal        |  Resolution:
 Keywords:  has-patch     |     Focuses:
--------------------------+---------------------

Comment (by spacedmonkey):

 Replying to [comment:17 peterwilsoncc]:
 > Replying to [comment:16 spacedmonkey]:
 > > I would recommend adding a new param to the function signature, that
 allows to pass post statuses. This means no bc break and developers have
 to opt in.
 >
 > The problem is that the back-compat break is retained due to the WHERE
 clause changing how the mysql optimizer processes the query.
 >
 > I tried setting `orderby => none, posts_per_page => -1` locally by the
 WHERE clause was still changing the results between 6.0 and 6.1
 >
 > In the [https://github.com/WordPress/wordpress-develop/pull/3573/ linked
 pull request]:
 >
 > * revert r54271, r54242, r54234.
 > * add caching

 How about adding an option to WP_Query to pass any or all to post status?
 If all, then do not add post status to the query.

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


More information about the wp-trac mailing list