Closed Bug 78276 Opened 24 years ago Closed 20 years ago

change name of "when" index on bugs_activity.bug_when column

Categories

(Bugzilla :: Installation & Upgrading, defect, P2)

2.10

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: myk, Assigned: mkanat)

References

Details

Attachments

(1 file, 1 obsolete file)

The BugZilla database has an index called "when" which indexes the "bug_when" column of the "bugs_activity" table. This appears to be a relic of an old naming scheme on b.m.o, since that index is called "bug_when" in new Bugzilla installations. "When" is a reserved keyword in MySQL, but it is not quoted in the nightly backup file, so importing that file into MySQL fails with a syntax error. This means that if we ever need to use our backup file we aren't going to be able to do so unless we edit it, which is non-trivial on a file greater than 800MB in size. Therefore this index needs to be renamed from "when" to some other name that isn't a MySQL reserved word, like "bug_when".
justdave: this seems somewhat concerning to me. Are our backups really bogus? Gerv
Assignee: endico → justdave
Severity: normal → critical
Priority: -- → P2
Isn't this fixed by that patch that standardizes the naming of all of the indexes?
(In reply to comment #2) > Isn't this fixed by that patch that standardizes the naming of all of the > indexes? more than likely... I think it drops all the existing indexes and recreates them. Max? If it tries to drop them by name it might still miss it.
Wow... Yeah, we won't catch that, because we check for indexes that are named after their columns. But with a one-line patch, we could add a check for that index, I do believe.
Severity: critical → major
Component: Bugzilla: Other b.m.o Issues → Installation & Upgrading
Product: mozilla.org → Bugzilla
Target Milestone: --- → Bugzilla 2.20
Version: other → 2.10
Assignee: justdave → mkanat
This should do it. I tested it by creating an index called "when" on bugs_activity, and it renamed it properly. This also exposed another bug, which I will file right now. (You'll see a "odd number of elements" warning when you run this patch, which is the bug that was exposed.)
Attachment #180446 - Flags: review?(myk)
Blocks: 289999
What if someone has already upgraded to a version that normalizes index names? Won't this index never go away then?
(In reply to comment #6) > What if someone has already upgraded to a version that normalizes index names? > Won't this index never go away then? (1) They would have had to have been running a version of Bugzilla previous to 2.8 at some point. (2) They would have had to have upgraded to a VERY recent CVS version, within the last week or two. Can you imagine anybody in their right mind who would have done that, or a particular reason why we should support them? :-)
No longer blocks: 289999
Depends on: 289999
Comment on attachment 180446 [details] [diff] [review] Rename any index called "when" found on the bugs_activity table Yeah, the likelihood is low, and the cost is minimal anyway. r=myk
Attachment #180446 - Flags: review?(myk) → review+
Flags: approval+
Attached patch v1.1 (fix bitrot) (deleted) — Splinter Review
Simple bitrot fix; carrying forward r+.
Attachment #180446 - Attachment is obsolete: true
Attachment #180749 - Flags: review+
Checking in Bugzilla/DB/Mysql.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Mysql.pm,v <-- Mysql.pm new revision: 1.13; previous revision: 1.12 done Checking in Bugzilla/DB/Schema/Mysql.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm,v <-- Mysql.pm new revision: 1.6; previous revision: 1.5 done
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
QA Contact: myk → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: