[wp-trac] [WordPress Trac] #34838: Comment descendant queries do not have determinate order
WordPress Trac
noreply at wordpress.org
Thu Dec 3 15:25:31 UTC 2015
#34838: Comment descendant queries do not have determinate order
--------------------------+-----------------------
Reporter: boonebgorges | Owner:
Type: defect (bug) | Status: new
Priority: high | Milestone: 4.4
Component: Comments | Version:
Severity: major | Keywords: has-patch
Focuses: |
--------------------------+-----------------------
[34546] introduced hierarchical comment queries. For efficiency, each
level of the hierarchy is fetched in a single SQL query, of the form
`SELECT ... WHERE comment_parent IN ( p1, p2, p3...)`. However, an `ORDER
BY` clause was not included in this query, with the result that in certain
environments (such as sites with large numbers of comments) MySQL could
return results in unexpected order. This was discovered by @tellyworth on
certain wordpress.com sites.
The proper fix is to add an `ORDER BY` clause to the descendant query. The
order can always be `ASC`, because non-top-level comments have always been
displayed in ascending order.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34838>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list