On Jan 16, 11:41 pm, osimons <[email protected]> wrote: > On Jan 16, 11:24 pm, osimons <[email protected]> wrote: > > > On Jan 16, 10:46 pm, Christian Boos <[email protected]> wrote: > > > On 1/16/2012 12:17 AM, osimons wrote: > > > > 2) Should we try to parse the report SQL and somehow extract any > > > > underlying order specification? > > > > It seems it could be "enough" to check if the SQL query is ending > > > with an `ORDER BY`, and in that case simply insert our extra > > > order columns, if any. But as that clause may contain arbitrary > > > expressions, we should at least check for an even count of > > > parentheses between the ORDER BY and the end of the query. > > > If we can safely extract and reuse the ORDER BY clause of the > > underlying query, we have no additional columns to insert - we would > > just reuse that at top level. > > I just covered normal report execution when I said we could reuse it > as-is. However, if the user clicks on a column to report the report > manually (once to select a new sort column ASC, doing it twice to > switch it to DESC) we would need to completely replace the ORDER BY > inside the report and replace it with "ORDER BY [__group__, ] <field> > ASC|DESC" (__group__ only used if the report is grouped of course). >
Arrgh. Annoying typo: ...if the user clicks on a column to RE-SORT the report manually... :::simon -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
