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
cb68c84b
Commit
cb68c84b
authored
Jun 20, 2001
by
jake%acutex.net
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for bug 86447 - ChangeFieldType() wasn't dealing with 'not null' properly.
r= justdave@syndicomm.com
parent
28bb0400
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
checksetup.pl
checksetup.pl
+9
-5
No files found.
checksetup.pl
View file @
cb68c84b
...
...
@@ -1411,6 +1411,9 @@ sub ChangeFieldType ($$$)
#print "0: $$ref[0] 1: $$ref[1] 2: $$ref[2] 3: $$ref[3] 4: $$ref[4]\n";
my
$oldtype
=
$ref
->
[
1
];
if
(
!
$ref
->
[
2
])
{
$oldtype
.=
qq{ not null}
;
}
if
(
$ref
->
[
4
])
{
$oldtype
.=
qq{ default "$ref->[4]"}
;
}
...
...
@@ -1419,7 +1422,8 @@ sub ChangeFieldType ($$$)
print
"Updating field type $field in table $table ...\n"
;
print
"old: $oldtype\n"
;
print
"new: $newtype\n"
;
$newtype
.=
" NOT NULL"
if
$$ref
[
3
];
# 'not null' should be passed as part of the call to ChangeFieldType()
# $newtype .= " NOT NULL" if $$ref[3];
$dbh
->
do
(
"ALTER TABLE $table
CHANGE $field
$field $newtype"
);
...
...
@@ -1549,10 +1553,10 @@ AddField('products', 'votesperuser', 'mediumint not null');
# tinytext is equivalent to varchar(255), which is quite huge, so I change
# them all to varchar(64).
ChangeFieldType
(
'bugs'
,
'product'
,
'varchar(64)'
);
ChangeFieldType
(
'bugs'
,
'product'
,
'varchar(64)
not null
'
);
ChangeFieldType
(
'components'
,
'program'
,
'varchar(64)'
);
ChangeFieldType
(
'products'
,
'product'
,
'varchar(64)'
);
ChangeFieldType
(
'versions'
,
'program'
,
'varchar(64)'
);
ChangeFieldType
(
'versions'
,
'program'
,
'varchar(64)
not null
'
);
# 2000-01-16 Added a "keywords" field to the bugs table, which
# contains a string copy of the entries of the keywords table for this
...
...
@@ -1967,8 +1971,8 @@ if (!($sth->fetchrow_arrayref()->[0])) {
# the size of the target_milestone field in the bugs table.
ChangeFieldType
(
'bugs'
,
'target_milestone'
,
'varchar(20) default "---"'
);
ChangeFieldType
(
'milestones'
,
'value'
,
'varchar(20)'
);
'varchar(20)
not null
default "---"'
);
ChangeFieldType
(
'milestones'
,
'value'
,
'varchar(20)
not null
'
);
# 2000-03-23 Added a defaultmilestone field to the products table, so that
...
...
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