Don't split the main query if there is no limit. This helps avoid extremely long query strings that could cause segfaults. Allow plugins to control splitting via split_the_query filter. see #20628
git-svn-id: https://develop.svn.wordpress.org/trunk@20740 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0de14403bf
commit
6f90e8abd6
@ -2626,7 +2626,9 @@ class WP_Query {
|
|||||||
return $r;
|
return $r;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $old_request == $this->request && "$wpdb->posts.*" == $fields ) {
|
$split_the_query = apply_filters( 'split_the_query', ( $old_request == $this->request && "$wpdb->posts.*" == $fields && !empty( $limits) ), $this );
|
||||||
|
|
||||||
|
if ( $split_the_query ) {
|
||||||
// First get the IDs and then fill in the objects
|
// First get the IDs and then fill in the objects
|
||||||
|
|
||||||
$this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
|
$this->request = "SELECT $found_rows $distinct $wpdb->posts.ID FROM $wpdb->posts $join WHERE 1=1 $where $groupby $orderby $limits";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user