Closed
Bug 302599
Opened 19 years ago
Closed 19 years ago
Saved searches using "days since bug changed" fail with "Can't use (to_days(now()) - to_days(bugs.delta_ts)) as a field name" error
Categories
(Bugzilla :: Query/Bug List, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.20
People
(Reporter: Wurblzap, Assigned: LpSolit)
References
Details
(Keywords: regression)
Attachments
(1 file, 2 obsolete files)
|
4.38 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
This is a regression of bug 280499 (based on bug 237862). Steps to reproduce: 1. On a pre-280499 install, create a saved search which contains a boolean chart referring to the "Days since bug changed" field. 2. Upgrade to a post-280499 version. 3. Run the saved search. This fails because the "Days since bug changed" field has changed from "(to_days(now()) - to_days(bugs.delta_ts))" to "(TO_DAYS(NOW()) - TO_DAYS(bugs.delta_ts))" in the meantime, so that Search.pm cannot find it any more.
Updated•19 years ago
|
| Assignee | ||
Comment 3•19 years ago
|
||
Marc, does it fix the problem for you? I hacked the URL to test it and it seems to work correctly. But maybe this introduces other regressions?
Attachment #200605 -
Flags: review?(wurblzap)
| Assignee | ||
Comment 4•19 years ago
|
||
Comment on attachment 200605 [details] [diff] [review] possible fix, v1 joel, could you have a look at this fix as well? Maybe it introduces other regressions?
Attachment #200605 -
Flags: review?(bugreport)
| Reporter | ||
Comment 5•19 years ago
|
||
Comment on attachment 200605 [details] [diff] [review] possible fix, v1 I think this is the right way to do it. I'll need to look into it in detail, though.
Comment 6•19 years ago
|
||
Comment on attachment 200605 [details] [diff] [review] possible fix, v1 This should be pretty safe
Attachment #200605 -
Flags: review?(bugreport) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #200605 -
Flags: review?(wurblzap)
| Assignee | ||
Updated•19 years ago
|
Assignee: query-and-buglist → LpSolit
Flags: approval?
Flags: approval2.20?
Comment 7•19 years ago
|
||
Comment on attachment 200605 [details] [diff] [review] possible fix, v1 I disagree with this change -- I think that we can just manually fix the old Saved Searches in checksetup.pl. I don't want to have to remember to "lc" the field names forever.
Comment 8•19 years ago
|
||
WTF are we using SQL for a field name anyway? That sucks. We should get it over with and give it a real field name, and do the SQL conversion on the back end after decoding the URL params/saved query params. Although we probably need to do something stupid like the lc() test for 2.20
Flags: approval?
Flags: approval2.20?
| Assignee | ||
Comment 9•19 years ago
|
||
I'm not going to play with field names or with Search.pm. Reassigning to default owner.
Assignee: LpSolit → query-and-buglist
| Reporter | ||
Comment 10•19 years ago
|
||
It seems to me comment 8 makes this to be related to bug 289602. What do you think?
| Assignee | ||
Comment 11•19 years ago
|
||
Another good reason to fix this bug quickly is that it blocks bug 301141, a PostgreSQL-specific one, when my patch v2 is applied (this doesn't mean my patch is wrong, this means we are inserting a stupid column name): checksetup.pl: DBD::Pg::db do failed: ERREUR: Value too long for type character varying(64) checksetup.pl: [for Statement "INSERT INTO fielddefs checksetup.pl: (name, description, mailhead, sortkey) checksetup.pl: VALUES (?, ?, ?, ?)"] at ./checksetup.pl line 1664 checksetup.pl: main::AddFDef('(TO_CHAR(NOW()::date, \'J\')::int - TO_CHAR(bugs.delta_ts::da...', 'Days since bug changed', 0) called at ./checksetup.pl line 1715
Severity: minor → normal
Flags: blocking2.22?
Comment 12•19 years ago
|
||
It's true that comment 8 is the right way to fix this, but I doubt we will be doing that for 2.20 or 2.22. It actually could be a significant architectural change. For now there is a much simpler workaround to fix this, which is simply to fix the saved queries.
| Assignee | ||
Comment 13•19 years ago
|
||
it wasn't that difficult after all. ;) Tested on both MySQL and PostgreSQL. Saved searches are correctly fixed, even when the case is different from the one expected. After running checksetup.pl, I can still run and edit saved searches correctly. The field name in the 'fielddefs' table has been renamed to 'days_elapsed'.
Assignee: query-and-buglist → LpSolit
Attachment #200605 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #202609 -
Flags: review?(mkanat)
| Assignee | ||
Comment 14•19 years ago
|
||
Comment on attachment 202609 [details] [diff] [review] patch, v2 my patch affects Search.pm, so asking joel too.
Attachment #202609 -
Flags: review?(bugreport)
Comment 15•19 years ago
|
||
Comment on attachment 202609 [details] [diff] [review] patch, v2 OH yeah, you're right. My only thought is -- shouldn't the $old_field_name be surrounded by \Q \E in the regex?
Attachment #202609 -
Flags: review?(mkanat) → review+
Comment 16•19 years ago
|
||
Comment on attachment 202609 [details] [diff] [review] patch, v2 Yes, it should, and I'm going to go ahead and deny review on this instead of saying "fix it on checkin" because that's a fairly big deal. *never* use unescaped variables in a regexp unless you expect the contents of the variable to actually contain a regexp that you plan to use.
Attachment #202609 -
Flags: review?(bugreport) → review-
Comment 17•19 years ago
|
||
ok, another stupid (or maybe not?) question... what about saved chart series?
| Assignee | ||
Comment 18•19 years ago
|
||
justdave is right, saved chart series have to be fixed too.
Attachment #202609 -
Attachment is obsolete: true
Attachment #202920 -
Flags: review?(justdave)
| Assignee | ||
Updated•19 years ago
|
Attachment #202920 -
Flags: review?(mkanat)
Comment 19•19 years ago
|
||
Comment on attachment 202920 [details] [diff] [review] patch, v3 r=mkanat by inspection of interdiff.
Attachment #202920 -
Flags: review?(mkanat) → review+
| Assignee | ||
Updated•19 years ago
|
Attachment #202920 -
Flags: review?(justdave)
| Assignee | ||
Updated•19 years ago
|
Flags: approval?
Flags: approval2.20?
Updated•19 years ago
|
Flags: blocking2.22?
Flags: blocking2.22+
Flags: approval?
Flags: approval2.20?
Flags: approval2.20+
Flags: approval+
| Assignee | ||
Comment 20•19 years ago
|
||
tip: Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.450; previous revision: 1.449 done Checking in Bugzilla/Search.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v <-- Search.pm new revision: 1.118; previous revision: 1.117 done 2.20: Checking in checksetup.pl; /cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v <-- checksetup.pl new revision: 1.412.2.10; previous revision: 1.412.2.9 done Checking in Bugzilla/Search.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Search.pm,v <-- Search.pm new revision: 1.99.2.8; previous revision: 1.99.2.7 done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•