Closed Bug 98368 Opened 24 years ago Closed 23 years ago

The DBI connect in globals.pl does not use the db_port defined in localconfig

Categories

(Bugzilla :: Bugzilla-General, defect, P1)

2.14
Sun
Solaris
defect

Tracking

()

RESOLVED FIXED
Bugzilla 2.16

People

(Reporter: gene-bmo, Assigned: justdave)

References

Details

Attachments

(1 file, 2 obsolete files)

In globals.pl, the DBI->connect does not use the db_port variable defined in localconfig. Which seems strange to me since checksetup.pl does use it.
Attached patch Patch for globals.pl (obsolete) — Splinter Review
A $::driver variable will need to be added when new databases are brought into the mix, such as Pg (PostgreSQL). It will need to be added to localconfig, checksetup.pl and globals. $::driver = 'mysql'; $::db = DBI->connect("DBI:$::driver:host=$::db_host;database=$name;port=$::db_port", $::db_user, $::db_pass) || die "Bugzilla is currently broken. Please try again later. " . "If the problem persists, please contact " . Param("maintainer") . ". The error you should quote is: " . $DBI::errstr;
Priority: -- → P1
Target Milestone: --- → Bugzilla 2.16
Unfortunately this will not work for Oracle. Oracles connectstring is not the same as Mysql and PostgreSQL. MySQL and PostgreSQL both support the format DBI->connect('dbi:driver:dbname=dbname;host=hostname;dbport=dbport', 'user', 'password'); Whereas Oracle uses the following DBI->connect('dbi:driver:oracle_sid', 'username', 'password'); There may be something I am doing incorrectly but I have tried it different ways without success. Oracles networking information is stored in it's own configuration files which can be found by placing $ENV{} variables in globals.pl. So much for DBI giving db independence cause there will need to be yet another conditional code block for use with Oracle.
This should probably add something into checksetup.pl to automatically add db_port to new localconfig files.
Ignore that last comment, I must have just had some good drugs.
*** Bug 100778 has been marked as a duplicate of this bug. ***
Comment on attachment 48299 [details] [diff] [review] Patch for globals.pl r=bbaetz, since its idential to the patch on the dupe. We can worry about oracle when we actually support it.
Attachment #48299 - Flags: review+
Comment on attachment 48299 [details] [diff] [review] Patch for globals.pl this entire section of the code has been completely redone since 2.14 was release (this patch appears to be against 2.14) and the patch has bitrotted.
Attachment #48299 - Flags: review-
Attachment #48299 - Attachment is obsolete: true
the section of code I was thinking of that had been redone was actually checksetup.pl... my new patch isn't very different, it just applies cleanly. :)
Attached patch doh! silly typoSplinter Review
Attachment #65959 - Attachment is obsolete: true
Comment on attachment 65960 [details] [diff] [review] doh! silly typo justdave's problem was the tabs->spaces changes, and my local version of patch defaulting to ignore whitespace, because of all the conflicts I got - I forgot to disable that. r=bbaetz Note to testers - mysql ignores the port option if you're using localhost, since it uses the socket instead.
Attachment #65960 - Flags: review+
Comment on attachment 65960 [details] [diff] [review] doh! silly typo This is actually Gene's patch, I just cleaned it for the tip. r=justdave
Attachment #65960 - Flags: review+
Checked in.
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
*** Bug 162406 has been marked as a duplicate of this bug. ***
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

Creator:
Created:
Updated:
Size: