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

WordPress Trac noreply at wordpress.org
Sun Nov 6 23:52:16 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 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

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


More information about the wp-trac mailing list