Opened 14 years ago
Closed 14 years ago
#20628 closed defect (bug) (fixed)
Splitting the main query can result in long query strings that segfault
| Reported by: | ryan | Owned by: | ryan |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.4 |
| Component: | Query | Version: | 3.4 |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
When paging hierarchical post types, edit.php via wp_edit_posts_query() can create very long query strings that enumerate every post ID to fetch. If a limit is not present or very large, the query may beed to fallback to the old single query style.
See #20621
Attachments (3)
Change History (12)
#1
@
14 years ago
Looks good. Should probably also pick an arbitrary limit like 500 at which point we no longer try to split the query.
#4
@
14 years ago
+1 for 'split_the_query'.
Still need to check the limit if anyone cares to patch that.
I already see !empty( $limits ) in there, so what's left?
#5
@
14 years ago
Oh, to not split the query if 'posts_per_page' => 500+? I don't know, that seems an unlikely edge case.
#6
follow-up:
↓ 7
@
14 years ago
You usually either want paging (i.e a reasonable number), or you don't. Plus, it can be handled with 'split_the_query'.
#7
in reply to: ↑ 6
@
14 years ago
Replying to scribu:
You usually either want paging (i.e a reasonable number), or you don't. Plus, it can be handled with 'split_the_query'.
While it *can* be handled with split the query, surely we've all seen posts_per_page = 99999 before — we should try to catch this by default.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
split_the_query filter. Don't split if no limit.