Closed Bug 212095 Opened 21 years ago Closed 21 years ago

checksetup.pl requires downgrade of DBD::mysql to 2.1026 (reports 'fielddefs' or 'tokens' already exists)

Categories

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

defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: jonl, Assigned: bbaetz)

References

Details

(Whiteboard: [fixed in 2.16.4] [fixed in 2.17.5])

Attachments

(3 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624

While upgrading from 2.14.1 to 2.16.3, I ran into a problem with checksetup.pl.
 I got "Table 'fielddefs' already exists at ./checksetup.pl line 1636".  I
talked to bbaetz @ acm . org about the problem.  He asked to be cc-ed but I
don't see how to do that in the new bug interface here.  Apparently the problem
stems from the latest version of DBD::mysql putting backquotes around all the
table names.  My tables (when uncommenting the table-printing debug code at line
1614 in checksetup.pl) looked like this:  	

Tables: `attachments` `bugs` `bugs_activity` `cc` `components` `dependencies`
`duplicates` `fielddefs` `groups` `keyworddefs` `keywords` `logincookies`
`longdescs` `milestones` `namedqueries` `products` `profiles`
`profiles_activity` `shadowlog` `tokens` `versions` `votes` `watch`

Downgrading to 2.1026 fixed this problem and allowed me to proceed.

Reproducible: Always

Steps to Reproduce:
1. Install latest bugzilla
2. Install Bundle::Bugzilla to get latest DBD::mysql (2.9002)
3. Attempt to upgrade old database using checksetup.pl
Actual Results:  
DBD::mysql::db do failed: Table 'fielddefs' already exists at ./checksetup.pl
line 1636.

Expected Results:  
Fixed up my old schema, I hope... ;-)
As confirmed this morning on IRC, the new DBD::mysql version is quoting the
returned names, which breaks our grep. We probably want to use table_info instead.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: checksetup.pl requires downgrade of DBD::mysql to 2.1026 → checksetup.pl requires downgrade of DBD::mysql to 2.1026
*** Bug 211973 has been marked as a duplicate of this bug. ***
-> me
Assignee: zach → bbaetz
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.18
Attached patch fix for 2.17.4Splinter Review
DBI quotes teh results of ->tables if the DBD driver procives quote_identifier,
which the newer version does.

Use table_info instead, and we can definativly just get the table, so don't
need the bogus regexp to split off the schema (aka db in mysql-speak)
Attachment #127526 - Flags: review?(myk)
The patch works for me, but I can't mark the bug as resolved.
*** Bug 212731 has been marked as a duplicate of this bug. ***
Comment on attachment 127526 [details] [diff] [review]
fix for 2.17.4

Ouch, just bumped my head into this.
To me, the patch looks right and works --> r=jouni (it's been a while since the
last one!). You may still want Myk's review in case you need a DBD/mysql
specialist's look - I couldn't swear that Columns[3] works right in every
configuration ;-)
Attachment #127526 - Flags: review+
Severity: normal → blocker
Flags: approval?
Flags: approval? → approval+
Fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Comment on attachment 127526 [details] [diff] [review]
fix for 2.17.4

removing unneeded review request
Attachment #127526 - Flags: review?(myk)
*** Bug 215538 has been marked as a duplicate of this bug. ***
This is a showstopper for installation, we need to fix this for 2.16.5, too.
Flags: approval+ → approval?
Whiteboard: [wanted for 2.16.5] [fixed on trunk]
This patch applies unmodified to the 2.16 branch. :)

checked in.

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.149.2.17; previous revision: 1.149.2.16
done
Whiteboard: [wanted for 2.16.5] [fixed on trunk] → [fixed in 2.16.5] [fixed on trunk]
Attached patch fix for 2.16.3Splinter Review
OK, turns out there was a conflict with where $sth was declared between the two
versions.  Here's the final patch that actually went into the 2.16 branch.
fixing version number, I'm getting ahead of myself. :)
Whiteboard: [fixed in 2.16.5] [fixed on trunk] → [fixed in 2.16.4] [fixed in 2.17.5]
Comment on attachment 129481 [details] [diff] [review]
fix for 2.16.3

I've tested (on a CVS version based on the 2.16 branch) and it works fine.
granting approval posthumously since this has already been checked in (I must
have missed it when I did the checkin.
Flags: approval? → approval+
*** Bug 219607 has been marked as a duplicate of this bug. ***
*** Bug 219618 has been marked as a duplicate of this bug. ***
Summary: checksetup.pl requires downgrade of DBD::mysql to 2.1026 → checksetup.pl requires downgrade of DBD::mysql to 2.1026 (reports 'fielddefs' already exists)
Attachment #127526 - Attachment description: fix → fix for 2.17.4
Attachment #129481 - Flags: review+
OS: Linux → All
Hardware: PC → All
*** Bug 215711 has been marked as a duplicate of this bug. ***
Target Milestone: Bugzilla 2.18 → Bugzilla 2.16
This fix breaks earlier versions of DBD::mysql. I am using perl-DBD-MySQL-1.
2216-4.i386.rpm from Red Hat 7.2, and checksetup.pl now blows up with "DBI 
table_info: invalid number of parameters: handle + 4". I've created an 
attachment:

http://bugzilla.mozilla.org/attachment.cgi?id=134845&action=view

(I should have included this comment when I created the attachment ... sorry).
Whats hte version number in the .pm file for mysql? What DBI version?

Please commentin a new bug, and cc me
Summary: checksetup.pl requires downgrade of DBD::mysql to 2.1026 (reports 'fielddefs' already exists) → checksetup.pl requires downgrade of DBD::mysql to 2.1026 (reports 'fielddefs' or 'tokens' already exists)
The followup is bug 224815.
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: