summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB
diff options
context:
space:
mode:
authormkanat%kerio.com <>2005-03-03 16:15:01 +0100
committermkanat%kerio.com <>2005-03-03 16:15:01 +0100
commit0e8f16e1c64b07cf6d90264f8f754307d340b30e (patch)
tree152e914a81eab2318a92d22e7c7033feec662ccc /Bugzilla/DB
parentd0d2e9fddc55b47bc9df5f5d60acac9f86d13183 (diff)
downloadbugzilla-0e8f16e1c64b07cf6d90264f8f754307d340b30e.tar.gz
bugzilla-0e8f16e1c64b07cf6d90264f8f754307d340b30e.tar.xz
Bug 284172: checksetup cannot run CREATE DATABASE on PostgreSQL
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=glob, a=justdave
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Mysql.pm6
-rw-r--r--Bugzilla/DB/Pg.pm13
2 files changed, 16 insertions, 3 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index d2204433b..4e0a3e5b2 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -47,11 +47,15 @@ use Carp;
# This module extends the DB interface via inheritance
use base qw(Bugzilla::DB);
+use constant REQUIRED_VERSION => '3.23.41';
+use constant PROGRAM_NAME => 'MySQL';
+
sub new {
my ($class, $user, $pass, $host, $dbname, $port, $sock) = @_;
# construct the DSN from the parameters we got
- my $dsn = "DBI:mysql:host=$host;database=$dbname;port=$port";
+ my $dsn = "DBI:mysql:host=$host;database=$dbname";
+ $dsn .= ";port=$port" if $port;
$dsn .= ";mysql_socket=$sock" if $sock;
my $self = $class->db_new($dsn, $user, $pass);
diff --git a/Bugzilla/DB/Pg.pm b/Bugzilla/DB/Pg.pm
index a23c38666..9766da383 100644
--- a/Bugzilla/DB/Pg.pm
+++ b/Bugzilla/DB/Pg.pm
@@ -47,12 +47,21 @@ use Carp;
# This module extends the DB interface via inheritance
use base qw(Bugzilla::DB);
+use constant REQUIRED_VERSION => '7.02.0000';
+use constant PROGRAM_NAME => 'PostgreSQL';
+
sub new {
my ($class, $user, $pass, $host, $dbname, $port) = @_;
+ # The default database name for PostgreSQL. We have
+ # to connect to SOME database, even if we have
+ # no $dbname parameter.
+ $dbname ||= 'template1';
+
# construct the DSN from the parameters we got
- my $dsn = "DBI:Pg:host=$host;dbname=$dbname;port=$port";
-
+ my $dsn = "DBI:Pg:host=$host;dbname=$dbname";
+ $dsn .= ";port=$port" if $port;
+
my $self = $class->db_new($dsn, $user, $pass);
# all class local variables stored in DBI derived class needs to have