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
8b471846
Commit
8b471846
authored
Mar 05, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 284525: Checksetup uses some bad SQL that is not cross-database compatible
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=glob, r=Tomas.Kopal, a=justdave
parent
943f4fe3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
21 deletions
+30
-21
checksetup.pl
checksetup.pl
+30
-21
No files found.
checksetup.pl
View file @
8b471846
...
...
@@ -2243,23 +2243,21 @@ my $headernum = 1;
sub
AddFDef
($$$)
{
my
(
$name
,
$description
,
$mailhead
)
=
(
@_
);
$name
=
$dbh
->
quote
(
$name
);
$description
=
$dbh
->
quote
(
$description
);
my
$sth
=
$dbh
->
prepare
(
"SELECT fieldid FROM fielddefs "
.
"WHERE name =
$name
"
);
$sth
->
execute
();
"WHERE name =
?
"
);
$sth
->
execute
(
$name
);
my
(
$fieldid
)
=
(
$sth
->
fetchrow_array
());
if
(
!
$fieldid
)
{
$
fieldid
=
'NULL'
;
$dbh
->
do
(
"INSERT INTO fielddefs "
.
"(fieldid, name, description, mailhead, sortkey) VALUES "
.
"($fieldid, $name, $description, $mailhead, $headernum)"
);
$
dbh
->
do
(
q{INSERT INTO fielddefs
(name, description, mailhead, sortkey)
VALUES (?, ?, ?, ?)}
,
undef
,
(
$name
,
$description
,
$mailhead
,
$headernum
)
);
}
else
{
$dbh
->
do
(
"UPDATE fielddefs "
.
"SET name = $name, description = $description, "
.
"mailhead = $mailhead, sortkey = $headernum "
.
"WHERE fieldid = $fieldid"
);
$dbh
->
do
(
q{UPDATE fielddefs
SET name = ?, description = ?,
mailhead = ?, sortkey = ?
WHERE fieldid = ?}
,
undef
,
$name
,
$description
,
$mailhead
,
$headernum
,
$fieldid
);
}
$headernum
++
;
}
...
...
@@ -2354,7 +2352,8 @@ sub PopulateEnumTable ($@) {
my
$sortorder
=
0
;
foreach
my
$value
(
@valuelist
)
{
$sortorder
=
$sortorder
+
100
;
my
$isactive
=
!
exists
(
$defaultinactive
{
$value
});
# Not active if the value exists in $defaultinactive
my
$isactive
=
exists
(
$defaultinactive
{
$value
})
?
0
:
1
;
print
"Inserting value '$value' in table $table"
.
" with sortkey $sortorder...\n"
;
$insert
->
execute
(
$value
,
$sortorder
,
$isactive
);
...
...
@@ -2401,16 +2400,24 @@ $sth = $dbh->prepare("SELECT description FROM products");
$sth
->
execute
;
unless
(
$sth
->
rows
)
{
print
"Creating initial dummy product 'TestProduct' ...\n"
;
$dbh
->
do
(
'INSERT INTO products(name, description, milestoneurl, disallownew, votesperuser, votestoconfirm) '
.
'VALUES ("TestProduct", '
.
'"This is a test product. This ought to be blown away and '
.
'replaced with real stuff in a finished installation of '
.
'bugzilla.", "", 0, 0, 0)'
);
my
$test_product_name
=
'TestProduct'
;
my
$test_product_desc
=
'This is a test product. This ought to be blown away and'
.
' replaced with real stuff in a finished installation of bugzilla.'
;
my
$test_product_version
=
'other'
;
$dbh
->
do
(
q{INSERT INTO products(name, description, milestoneurl,
disallownew, votesperuser, votestoconfirm)
VALUES (?, ?, '', ?, ?, ?)}
,
undef
,
$test_product_name
,
$test_product_desc
,
0
,
0
,
0
);
# We could probably just assume that this is "1", but better
# safe than sorry...
my
$product_id
=
$dbh
->
bz_last_key
(
'products'
,
'id'
);
$dbh
->
do
(
qq{INSERT INTO versions (value, product_id) VALUES ("other", $product_id)}
);
$dbh
->
do
(
q{INSERT INTO versions (value, product_id)
VALUES (?, ?)}
,
undef
,
$test_product_version
,
$product_id
);
# note: since admin user is not yet known, components gets a 0 for
# initialowner and this is fixed during final checks.
$dbh
->
do
(
"INSERT INTO components (name, product_id, description, "
.
...
...
@@ -2420,7 +2427,9 @@ unless ($sth->rows) {
"'This is a test component in the test product database. "
.
"This ought to be blown away and replaced with real stuff in "
.
"a finished installation of Bugzilla.', 0, 0)"
);
$dbh
->
do
(
qq{INSERT INTO milestones (product_id, value) VALUES ($product_id,"---")}
);
$dbh
->
do
(
q{INSERT INTO milestones (product_id, value, sortkey)
VALUES (?,?,?)}
,
undef
,
$product_id
,
'---'
,
0
);
}
...
...
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