Modify ↓
#12296 closed defect (worksforme)
Trac Report - using LIMIT option in a SQL query is not consistent with the 'Max items per page' setting
Reported by: | Owned by: | Ryan J Ollos | |
---|---|---|---|
Priority: | lowest | Milestone: | |
Component: | general | Version: | 1.0.1 |
Severity: | trivial | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I have a track report with the following SQL:
SELECT name as milestone FROM milestone ORDER BY name DESC LIMIT 2000
I have 561 milestones in my trac system, so it shows a page with 561 milestones. However, there are 6 buttons (1,2,3,4,5,6); if I click on 2 I get a heading with "(101 - 661 of 561)", but in fact, I still get all the 561 milestones.
Attachments (0)
Change History (3)
comment:1 by , 9 years ago
Milestone: | → 1.0.10 |
---|---|
Owner: | set to |
Status: | new → assigned |
comment:2 by , 9 years ago
I think the query should be the following.
SELECT * FROM (SELECT name as milestone FROM milestone ORDER BY name DESC LIMIT 2000) AS t @LIMIT_OFFSET@
See TracReports#rewriting, [11096] and #10540.
comment:3 by , 9 years ago
Milestone: | 1.0.10 |
---|---|
Resolution: | → worksforme |
Status: | assigned → closed |
Thanks, I wasn't very familiar with reports. Your suggestion works well.
Note:
See TracTickets
for help on using tickets.
Confirmed, pagination doesn't work correctly when the query includes a
LIMIT
clause.