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
26120c8f
Commit
26120c8f
authored
Jun 21, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When doing bz_alter_column, if
https://bugzilla.mozilla.org/show_bug.cgi?id=573441
parent
0fa7022e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
Schema.pm
Bugzilla/DB/Schema.pm
+5
-2
No files found.
Bugzilla/DB/Schema.pm
View file @
26120c8f
...
...
@@ -2157,6 +2157,10 @@ sub get_alter_column_ddl {
my
$default
=
$new_def
->
{
DEFAULT
};
my
$default_old
=
$old_def
->
{
DEFAULT
};
if
(
defined
$default
)
{
$default
=
$specific
->
{
$default
}
if
exists
$specific
->
{
$default
};
}
# This first condition prevents "uninitialized value" errors.
if
(
!
defined
$default
&&
!
defined
$default_old
)
{
# Do Nothing
...
...
@@ -2170,7 +2174,6 @@ sub get_alter_column_ddl {
elsif
(
(
defined
$default
&&
!
defined
$default_old
)
||
(
$default
ne
$default_old
)
)
{
$default
=
$specific
->
{
$default
}
if
exists
$specific
->
{
$default
};
push
(
@statements
,
"ALTER TABLE $table ALTER COLUMN $column "
.
" SET DEFAULT $default"
);
}
...
...
@@ -2179,7 +2182,7 @@ sub get_alter_column_ddl {
if
(
!
$old_def
->
{
NOTNULL
}
&&
$new_def
->
{
NOTNULL
})
{
my
$setdefault
;
# Handle any fields that were NULL before, if we have a default,
$setdefault
=
$
new_def
->
{
DEFAULT
}
if
exists
$new_def
->
{
DEFAULT
}
;
$setdefault
=
$
default
if
defined
$default
;
# But if we have a set_nulls_to, that overrides the DEFAULT
# (although nobody would usually specify both a default and
# a set_nulls_to.)
...
...
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