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
25ede8ea
Commit
25ede8ea
authored
Sep 03, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 299230: Schema-Modification Functions Shouldn't Die on A DB-side Deletion Failure
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=joel, a=justdave
parent
c3d52c4b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
3 deletions
+16
-3
DB.pm
Bugzilla/DB.pm
+16
-3
No files found.
Bugzilla/DB.pm
View file @
25ede8ea
...
...
@@ -513,7 +513,10 @@ sub bz_drop_column {
$table
,
$column
);
print
"Deleting unused column $column from table $table ...\n"
;
foreach
my
$sql
(
@statements
)
{
$self
->
do
(
$sql
);
# Because this is a deletion, we don't want to die hard if
# we fail because of some local customization. If something
# is already gone, that's fine with us!
eval
{
$self
->
do
(
$sql
);
}
or
warn
"Failed SQL: [$sql] Error: $@"
;
}
$self
->
_bz_real_schema
->
delete_column
(
$table
,
$column
);
$self
->
_bz_store_real_schema
;
...
...
@@ -553,7 +556,12 @@ sub bz_drop_index_raw {
my
@statements
=
$self
->
_bz_schema
->
get_drop_index_ddl
(
$table
,
$name
);
print
"Removing index '$name' from the $table table...\n"
unless
$silent
;
$self
->
do
(
$_
)
foreach
(
@statements
);
foreach
my
$sql
(
@statements
)
{
# Because this is a deletion, we don't want to die hard if
# we fail because of some local customization. If something
# is already gone, that's fine with us!
eval
{
$self
->
do
(
$sql
)
}
or
warn
"Failed SQL: [$sql] Error: $@"
;
}
}
sub
bz_drop_table
{
...
...
@@ -564,7 +572,12 @@ sub bz_drop_table {
if
(
$table_exists
)
{
my
@statements
=
$self
->
_bz_schema
->
get_drop_table_ddl
(
$name
);
print
"Dropping table $name...\n"
;
$self
->
do
(
$_
)
foreach
(
@statements
);
foreach
my
$sql
(
@statements
)
{
# Because this is a deletion, we don't want to die hard if
# we fail because of some local customization. If something
# is already gone, that's fine with us!
eval
{
$self
->
do
(
$sql
);
}
or
warn
"Failed SQL: [$sql] Error: $@"
;
}
$self
->
_bz_real_schema
->
delete_table
(
$name
);
$self
->
_bz_store_real_schema
;
}
...
...
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