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
7b48d43d
Commit
7b48d43d
authored
Dec 15, 2010
by
Max Kanat-Alexander
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Checkin fix for bug 619016: "DEFAULT TRUE" and "DEFAULT FALSE" were no longer
getting properly translated to 1 and 0 inside of _set_nulls_sql in Bugzilla::DB::Schema.
parent
87bb76f2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
7 deletions
+11
-7
Schema.pm
Bugzilla/DB/Schema.pm
+11
-7
No files found.
Bugzilla/DB/Schema.pm
View file @
7b48d43d
...
...
@@ -2243,18 +2243,22 @@ sub get_alter_column_ddl {
return
@statements
;
}
# Helps handle any fields that were NULL before, if we have a default,
# when doing an ALTER COLUMN.
sub
_set_nulls_sql
{
my
(
$self
,
$table
,
$column
,
$new_def
,
$set_nulls_to
)
=
@_
;
my
$setdefault
;
# Handle any fields that were NULL before, if we have a default,
$setdefault
=
$new_def
->
{
DEFAULT
}
if
defined
$new_def
->
{
DEFAULT
};
# But if we have a set_nulls_to, that overrides the DEFAULT
my
$default
=
$new_def
->
{
DEFAULT
};
# If we have a set_nulls_to, that overrides the DEFAULT
# (although nobody would usually specify both a default and
# a set_nulls_to.)
$setdefault
=
$set_nulls_to
if
defined
$set_nulls_to
;
$default
=
$set_nulls_to
if
defined
$set_nulls_to
;
if
(
defined
$default
)
{
my
$specific
=
$self
->
{
db_specific
};
$default
=
$specific
->
{
$default
}
if
exists
$specific
->
{
$default
};
}
my
@sql
;
if
(
defined
$
set
default
)
{
push
(
@sql
,
"UPDATE $table SET $column = $
set
default"
if
(
defined
$default
)
{
push
(
@sql
,
"UPDATE $table SET $column = $default"
.
" WHERE $column IS NULL"
);
}
return
@sql
;
...
...
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