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
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
7261190b
Commit
7261190b
authored
Jul 19, 2007
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 388765: Bugzilla::DB::db_new should accept attributes that *override* the default attributes
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner) a=mkanat
parent
33f63df5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
15 deletions
+23
-15
DB.pm
Bugzilla/DB.pm
+23
-15
No files found.
Bugzilla/DB.pm
View file @
7261190b
...
@@ -942,22 +942,28 @@ sub bz_rollback_transaction {
...
@@ -942,22 +942,28 @@ sub bz_rollback_transaction {
#####################################################################
#####################################################################
sub
db_new
{
sub
db_new
{
my
(
$class
,
$dsn
,
$user
,
$pass
,
$
attribute
s
)
=
@_
;
my
(
$class
,
$dsn
,
$user
,
$pass
,
$
override_attr
s
)
=
@_
;
# set up default attributes used to connect to the database
# set up default attributes used to connect to the database
# (if not defined by DB specific implementation)
# (may be overridden by DB driver implementations)
$attributes
=
{
RaiseError
=>
0
,
my
$attributes
=
{
RaiseError
=>
0
,
AutoCommit
=>
1
,
AutoCommit
=>
1
,
PrintError
=>
0
,
PrintError
=>
0
,
ShowErrorStatement
=>
1
,
ShowErrorStatement
=>
1
,
HandleError
=>
\&
_handle_error
,
HandleError
=>
\&
_handle_error
,
TaintIn
=>
1
,
TaintIn
=>
1
,
FetchHashKeyName
=>
'NAME'
,
FetchHashKeyName
=>
'NAME'
,
# Note: NAME_lc causes crash on ActiveState Perl
# Note: NAME_lc causes crash on ActiveState Perl
# 5.8.4 (see Bug 253696)
# 5.8.4 (see Bug 253696)
# XXX - This will likely cause problems in DB
# XXX - This will likely cause problems in DB
# back ends that twiddle column case (Oracle?)
# back ends that twiddle column case (Oracle?)
}
if
(
!
defined
(
$attributes
));
};
if
(
$override_attrs
)
{
foreach
my
$key
(
keys
%
$override_attrs
)
{
$attributes
->
{
$key
}
=
$override_attrs
->
{
$key
};
}
}
# connect using our known info to the specified db
# connect using our known info to the specified db
# Apache::DBI will cache this when using mod_perl
# Apache::DBI will cache this when using mod_perl
...
@@ -2340,7 +2346,9 @@ Constructor
...
@@ -2340,7 +2346,9 @@ Constructor
=item C<$pass> - password used to log in to the database
=item C<$pass> - password used to log in to the database
=item C<\%attributes> - set of attributes for DB connection (optional)
=item C<\%override_attrs> - set of attributes for DB connection (optional).
You only have to set attributes that you want to be different from
the default attributes set inside of C<db_new>.
=back
=back
...
...
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