Closed Bug 344647 Opened 18 years ago Closed 18 years ago

checksetup.pl can create two database connections instead of one

Categories

(Bugzilla :: Installation & Upgrading, defect)

2.23
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.20

People

(Reporter: mkanat, Assigned: mkanat)

Details

Attachments

(1 file)

469 bytes, patch
LpSolit
: review+
bugzilla-mozilla
: review+
Details | Diff | Splinter Review
Instead of using Bugzilla->dbh to connect to the database, the first time checksetup connects it uses Bugzilla::DB::connect_main(). It *really* shouldn't do this. This means that if anybody uses "Bugzilla->dbh" in checksetup.pl, that's actually a *different* database object! This can cause all sorts of trouble, including messing up the Schema (because one object will have a different Schema than another).
Status: NEW → ASSIGNED
Attached patch v1Splinter Review
Okay, here's a one-line patch that fixes it.

Thankfully, this bug doesn't affect us at all, yet, because we don't use Bugzilla->dbh inside of a subroutine or anything. But it could affect any future patch, and it can cause havoc with customizations.

In fact, twice I've spent hours trying to track down this exact problem, when tracking down issues in custom code. So this time I'm patching it. :-)
Attachment #229220 - Flags: review?(bugzilla-mozilla)
Comment on attachment 229220 [details] [diff] [review]
v1

Looks good, but I didn't test with a fresh install. But I don't see how this could be wrong. r=LpSolit

2nd review still required, just to be sure I'm not missing something.
Attachment #229220 - Flags: review+
Patch was checked in as part of bug 346375 and works ok.

*** This bug has been marked as a duplicate of 346375 ***
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → DUPLICATE
Comment on attachment 229220 [details] [diff] [review]
v1

Cancelling review as patch was checked in.
Attachment #229220 - Flags: review?(bugzilla-mozilla)
I missed the target milestone :-(
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Comment on attachment 229220 [details] [diff] [review]
v1

r=bkor

tested on 2.20: existing+empty db
tested on 2.22: existing+empty db+upgrade from 2.20
Attachment #229220 - Flags: review+
Flags: approval2.22?
Flags: approval2.20?
Flags: approval2.22?
Flags: approval2.22+
Flags: approval2.20?
Flags: approval2.20+
don't you want to commit this one?
Ah yes, I do! I missed it because it was only approved for the branch. :-)

2.22:

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.469.2.11; previous revision: 1.469.2.10
done
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
This patch didn't land on the 2.20 branch. Either do it or retarget the bug to 2.22 and remove the approval2.20+ flag.
Oh, you're right! Thanks.

2.20:

Checking in checksetup.pl;
/cvsroot/mozilla/webtools/bugzilla/checksetup.pl,v  <--  checksetup.pl
new revision: 1.412.2.24; previous revision: 1.412.2.23
done
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: