[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 23:31:05 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:21 spacedmonkey]:
> In my manual testing, I get the same result now for both queries.
I'd tried this last week but was seeing different results.
I've pushed a [https://github.com/WordPress/wordpress-develop/pull/3577/
pull request with your changes and some tests] that pass on the GitHub
workflow but do not pass on my local. Without your changes the tests fail
both on GitHub and locally but the number of failures differ (one locally,
two on GitHub).
This highlights the inherent problem, without an orderby the order in
which results are returned is undefined.
I reached out to a mate who has contributed to MySQL in the past and
without an order specified, MySQL uses the optimal index based on the
WHERE clause as judged by the optimizer of that particular version and
that particular engine.
The problem is, as demonstrated by different results on my local, that
different version/engine combinations use different algorithms for
determining the optimal index to use.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/56991#comment:22>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list