Edgewall Software
Modify

Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#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: motumboe@… 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 Ryan J Ollos, 9 years ago

Milestone: 1.0.10
Owner: set to Ryan J Ollos
Status: newassigned

Confirmed, pagination doesn't work correctly when the query includes a LIMIT clause.

comment:2 by Jun Omae, 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 Ryan J Ollos, 9 years ago

Milestone: 1.0.10
Resolution: worksforme
Status: assignedclosed

Thanks, I wasn't very familiar with reports. Your suggestion works well.

Last edited 9 years ago by Ryan J Ollos (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.