Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ivan Ivlev
bugzilla
Commits
1af7f272
You need to sign in or sign up before continuing.
Commit
1af7f272
authored
May 27, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 286672: Require correct DBD depending on the $db_driver in use
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=justdave
parent
31985208
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
5 deletions
+25
-5
DB.pm
Bugzilla/DB.pm
+5
-1
Mysql.pm
Bugzilla/DB/Mysql.pm
+1
-0
Pg.pm
Bugzilla/DB/Pg.pm
+1
-0
checksetup.pl
checksetup.pl
+18
-4
No files found.
Bugzilla/DB.pm
View file @
1af7f272
...
...
@@ -187,7 +187,7 @@ sub _handle_error {
}
# List of abstract methods we are checking the derived class implements
our
@_abstract_methods
=
qw(REQUIRED_VERSION PROGRAM_NAME
our
@_abstract_methods
=
qw(REQUIRED_VERSION PROGRAM_NAME
DBD_VERSION
new sql_regexp sql_not_regexp sql_limit sql_to_days
sql_date_format sql_interval
bz_lock_tables bz_unlock_tables)
;
...
...
@@ -963,6 +963,10 @@ to the admin to let them know what DB they're running.
The name of the Bugzilla::DB module that we are. For example, for the MySQL
Bugzilla::DB module, this would be "Mysql." For PostgreSQL it would be "Pg."
=item C<DBD_VERSION>
The minimum version of the DBD module that we require for this database.
=head1 CONNECTION
A new database handle to the required database can be created using this
...
...
Bugzilla/DB/Mysql.pm
View file @
1af7f272
...
...
@@ -49,6 +49,7 @@ use base qw(Bugzilla::DB);
use
constant
REQUIRED_VERSION
=>
'3.23.41'
;
use
constant
PROGRAM_NAME
=>
'MySQL'
;
use
constant
MODULE_NAME
=>
'Mysql'
;
use
constant
DBD_VERSION
=>
'2.9003'
;
sub
new
{
my
(
$class
,
$user
,
$pass
,
$host
,
$dbname
,
$port
,
$sock
)
=
@_
;
...
...
Bugzilla/DB/Pg.pm
View file @
1af7f272
...
...
@@ -51,6 +51,7 @@ use constant BLOB_TYPE => { pg_type => DBD::Pg::PG_BYTEA };
use
constant
REQUIRED_VERSION
=>
'7.03.0000'
;
use
constant
PROGRAM_NAME
=>
'PostgreSQL'
;
use
constant
MODULE_NAME
=>
'Pg'
;
use
constant
DBD_VERSION
=>
'1.31'
;
sub
new
{
my
(
$class
,
$user
,
$pass
,
$host
,
$dbname
,
$port
)
=
@_
;
...
...
checksetup.pl
View file @
1af7f272
...
...
@@ -300,10 +300,6 @@ my $modules = [
version
=>
'1.38'
},
{
name
=>
'DBD::mysql'
,
version
=>
'2.9003'
},
{
name
=>
'File::Spec'
,
version
=>
'0.82'
},
...
...
@@ -1469,9 +1465,27 @@ $::ENV{'PATH'} = $origPath;
if
(
$my_db_check
)
{
# Do we have the database itself?
# Unfortunately, $my_db_driver doesn't map perfectly between DBD
# and Bugzilla::DB. We need to fix the case a bit.
(
my
$dbd_name
=
trim
(
$my_db_driver
))
=~
s/(\w+)/\u\L$1/g
;
# And MySQL is special, because it's all lowercase in DBD.
$dbd_name
=
'mysql'
if
$dbd_name
eq
'Mysql'
;
my
$dbd
=
"DBD::$dbd_name"
;
unless
(
eval
(
"require $dbd"
))
{
print
"Bugzilla requires that perl's $dbd be installed.\n"
.
"To install this module, you can do:\n "
.
" "
.
install_command
(
$dbd
)
.
"\n"
;
exit
;
}
my
$dbh
=
Bugzilla::DB::
connect_main
(
"no database connection"
);
my
$sql_want
=
$dbh
->
REQUIRED_VERSION
;
my
$sql_server
=
$dbh
->
PROGRAM_NAME
;
my
$dbd_ver
=
$dbh
->
DBD_VERSION
;
unless
(
have_vers
(
$dbd
,
$dbd_ver
))
{
die
"Bugzilla requires at least version $dbd_ver of $dbd."
;
}
printf
(
"Checking for %15s %-9s "
,
$sql_server
,
"(v$sql_want)"
)
unless
$silent
;
my
$sql_vers
=
$dbh
->
bz_server_version
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment