Closed Bug 124127 Opened 23 years ago Closed 22 years ago

Software error when sorting buglist by "Opened" date

Categories

(Bugzilla :: Query/Bug List, defect)

2.15
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: afranke, Assigned: endico)

References

Details

(Keywords: regression, Whiteboard: [blocker will fix])

Attachments

(1 file)

Sorting a buglist by "Opened" date doesn't work:

Software error:

Invalid order: unix_timestamp(bugs.creation_ts), map_assigned_to.login_name,
bugs.bug_id at /home/bugzilla/apache/htdocs/buglist.cgi line
1161. 

With the new templatized buglist.cgi from bug 103778 the message is different:

Software error:

SELECT DISTINCT bugs.bug_id, bugs.groupset, unix_timestamp(bugs.creation_ts),
bugs.bug_type, bugs.bug_severity, bugs.priority,
map_assigned_to.login_name, bugs.bug_status, bugs.resolution, bugs.product,
bugs.component, bugs.target_milestone, bugs.short_desc FROM
bugs, profiles map_assigned_to, profiles map_reporter LEFT JOIN profiles
map_qa_contact ON bugs.qa_contact = map_qa_contact.userid LEFT
JOIN cc selectVisible_cc ON bugs.bug_id = selectVisible_cc.bug_id AND
selectVisible_cc.who = 5 WHERE ((bugs.groupset & 31736) =
bugs.groupset OR (bugs.reporter_accessible = 1 AND bugs.reporter = 5) OR
(bugs.assignee_accessible = 1 AND bugs.assigned_to = 5) OR
(bugs.qacontact_accessible = 1 AND bugs.qa_contact = 5) OR
(bugs.cclist_accessible = 1 AND selectVisible_cc.who = 5 AND not
isnull(selectVisible_cc.who))) AND bugs.assigned_to = map_assigned_to.userid AND
bugs.reporter = map_reporter.userid AND (bugs.bug_status
= 'UNCONFIRMED' OR bugs.bug_status = 'NEW' OR bugs.bug_status = 'ASSIGNED' OR
bugs.bug_status = 'REOPENED') GROUP BY bugs.bug_id ORDER BY
unix_timestamp(bugs.creation_ts), map_assigned_to.login_name, bugs.bug_id : You
have an error in your SQL syntax near
'unix_timestamp(bugs.creation_ts), map_assigned_to.login_name, bugs.bug_id ' at
line 6 at globals.pl line 249.
Hm, actually this currently works on bugzilla.mozilla.org .

Can someone please test whether this is broken in current cvs or not?
If it's not broken in cvs, is it broken with the buglist patch from bug 103778?
If it's neither of these two, I can take a further look which of my patches may
have caused it...
Keywords: regression
Target Milestone: --- → Bugzilla 2.16
This works fine on http://landfill.tequilarista.org/bugzilla-tip/ .

And it seems I can't test it on http://landfill.tequilarista.org/bztemplate/
because it the database schema does not seem to work with the bugzilla version:

> Unknown column 'cryptpassword' in 'field list' at globals.pl line 222. 
Hm, actually, on landfill-bztemplate I get a nice error message in html:

Error 

   The custom sort order you specified in your form submission or cookie    
   contains an invalid column name bugs.creation_ts.

Am I the only one getting a software error?
Ignore that patch.  It is supposed to be on bug 124587.
>Maybe the code there is not up-to-date?

That's correct, the code there was way out of date.  This has been corrected.
This is either a MySQL bug or a feature that doesn't exist in older versions of
MySQL.  The query works on 3.23.41 (on my workstation) and 3.23.44 (on mothra),
but not on 3.22.30 (on landfill).  unix_timestamp() was introduced in 3.20.17. 
Maybe it can't be used in an ORDER BY statement on older versions?
Do you need to order by the function? Can't you just ORDER BY the actual value?
mysql should do the sorting for you, shouldn't it?
maybe we should just up the minimum MySQL version.  We're already planning to
anyway, aren't we?
We could order by the actual value, but it means hacking buglist.cgi to order by
different values than it selects.  We could also up the MySQL requirement, but
that's too drastic a measure for a bug of this size (unless we are going to do
it anyway).  We should remove the unix_timestamp call and use the "str2time"
function of Date::Parse (which we already require) to convert the MySQL
date/time value to a Unix time value in DiffDate.  I'll add this to my patch in
bug 103778.
Depends on: 103778
Whiteboard: [blocker will fix]
This bug has been fixed by the check-in for bug 103778.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: