Closed
Bug 301901
Opened 19 years ago
Closed 19 years ago
Index rename failure when renaming an index called PRIMARY
Categories
(Bugzilla :: Installation & Upgrading, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 2.20
People
(Reporter: justdave, Assigned: mkanat)
Details
(Keywords: regression)
Attachments
(2 files)
|
20.54 KB,
text/plain
|
Details | |
|
761 bytes,
patch
|
justdave
:
review+
|
Details | Diff | Splinter Review |
Renaming index PRIMARY to cc_bug_id_idx...
DBD::mysql::db do failed: You have an error in your SQL syntax near 'PRIMARY' at
line 1 at Bugzilla/DB/Mysql.pm line 393
Bugzilla::DB::Mysql::bz_setup_database('Bugzilla::DB::Mysql=HASH(0xada0eb8)')
called at ./checksetup.pl line 1591| Reporter | ||
Updated•19 years ago
|
Flags: blocking2.20+
Target Milestone: --- → Bugzilla 2.20
| Assignee | ||
Comment 1•19 years ago
|
||
Is it possible for me to get a copy of that DB's Schema?
Assignee: installation → mkanat
Updated•19 years ago
|
Whiteboard: [info needed]
| Reporter | ||
Comment 2•19 years ago
|
||
| Reporter | ||
Comment 3•19 years ago
|
||
sucks being so behind on bugmail. sorry for the delay on getting this to you. I actually still haven't seen the bugmail, I just hunted this bug down to see if it was fixed yet because the Bugzilla in question has been out of commission since that attempted upgrade (and because it's a small Bugzilla with only 3 or 4 people using it I was lazy and didn't make a backup first).
Whiteboard: [info needed]
| Assignee | ||
Comment 4•19 years ago
|
||
This should fix it. Basically, when I re-wrote the index-renaming code to be faster, I forgot to get back in the escaping of reserved words. In order to get the index-renaming code to run again on your DB, you'll need to do: DROP INDEX bugs_assigned_to_idx ON bugs; CREATE INDEX ON bugs(assigned_to); I'm assuming that you didn't run checksetup again *after* this error, but if you did, you may also want to try: TRUNCATE TABLE bz_schema; Just to be safe.
Attachment #191149 -
Flags: review?(justdave)
| Assignee | ||
Comment 5•19 years ago
|
||
Note that this will only happen if we're upgrading from something that was backed-up and restored with a buggy mysqldump that renamed UNIQUE indexes to "PRIMARY".
Severity: critical → major
Status: NEW → ASSIGNED
Summary: Index rename failure on upgrade from 2.17.7 to 2.20rc1 → Index rename failure when renaming an index called PRIMARY
| Reporter | ||
Comment 6•19 years ago
|
||
(In reply to comment #5) > Note that this will only happen if we're upgrading from something that was > backed-up and restored with a buggy mysqldump that renamed UNIQUE indexes to > "PRIMARY". Yeah, that's probably the case... this bugzilla install has been moved between machines before.
| Reporter | ||
Comment 7•19 years ago
|
||
Comment on attachment 191149 [details] [diff] [review] v1 this worked on the problem database :)
Attachment #191149 -
Flags: review?(justdave) → review+
| Reporter | ||
Updated•19 years ago
|
Flags: approval2.20+
Flags: approval+
| Assignee | ||
Comment 8•19 years ago
|
||
I think this is safe to check-in during the QA-test phase of 2.20rc2, because it only touches checksetup code (which has extremely heavy automated testing) and it fixes a regression in database-upgrade code which is very difficult to fix afterward without a database backup. Tip: Checking in Bugzilla/DB/Schema/Mysql.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm,v <-- Mysql.pm new revision: 1.11; previous revision: 1.10 done 2.20: Checking in Bugzilla/DB/Schema/Mysql.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/DB/Schema/Mysql.pm,v <-- Mysql.pm new revision: 1.10.2.1; previous revision: 1.10 done
You need to log in
before you can comment on or make changes to this bug.
Description
•