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
56c9e803
Commit
56c9e803
authored
Aug 18, 2009
by
mkanat%bugzilla.org
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 507969: Speed up checksetup for cases when it's doing nothing
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
parent
dbfeceeb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
22 deletions
+22
-22
Mysql.pm
Bugzilla/DB/Mysql.pm
+12
-13
DB.pm
Bugzilla/Install/DB.pm
+10
-9
No files found.
Bugzilla/DB/Mysql.pm
View file @
56c9e803
...
@@ -317,15 +317,11 @@ EOT
...
@@ -317,15 +317,11 @@ EOT
}
}
# Figure out if any existing tables are of type ISAM and convert them
my
%
table_status
=
@
{
$self
->
selectcol_arrayref
(
"SHOW TABLE STATUS"
,
# to type MyISAM if so. ISAM tables are deprecated in MySQL 3.23,
{
Columns
=>
[
1
,
2
]})
};
# which Bugzilla now requires, and they don't support more than 16
# indexes per table, which Bugzilla needs.
my
$table_status
=
$self
->
selectall_arrayref
(
"SHOW TABLE STATUS"
);
my
@isam_tables
;
my
@isam_tables
;
foreach
my
$row
(
@$table_status
)
{
foreach
my
$name
(
keys
%
table_status
)
{
my
(
$name
,
$type
)
=
@$row
;
push
(
@isam_tables
,
$name
)
if
$table_status
{
$name
}
eq
"ISAM"
;
push
(
@isam_tables
,
$name
)
if
$type
eq
"ISAM"
;
}
}
if
(
scalar
(
@isam_tables
))
{
if
(
scalar
(
@isam_tables
))
{
...
@@ -347,7 +343,9 @@ EOT
...
@@ -347,7 +343,9 @@ EOT
# We want to convert tables to InnoDB, but it's possible that they have
# We want to convert tables to InnoDB, but it's possible that they have
# fulltext indexes on them, and conversion will fail unless we remove
# fulltext indexes on them, and conversion will fail unless we remove
# the indexes.
# the indexes.
if
(
grep
(
$_
eq
'bugs'
,
@tables
))
{
if
(
grep
(
$_
eq
'bugs'
,
@tables
)
and
!
grep
(
$_
eq
'bugs_fulltext'
,
@tables
))
{
if
(
$self
->
bz_index_info_real
(
'bugs'
,
'short_desc'
))
{
if
(
$self
->
bz_index_info_real
(
'bugs'
,
'short_desc'
))
{
$self
->
bz_drop_index_raw
(
'bugs'
,
'short_desc'
);
$self
->
bz_drop_index_raw
(
'bugs'
,
'short_desc'
);
}
}
...
@@ -356,7 +354,9 @@ EOT
...
@@ -356,7 +354,9 @@ EOT
$sd_index_deleted
=
1
;
# Used for later schema cleanup.
$sd_index_deleted
=
1
;
# Used for later schema cleanup.
}
}
}
}
if
(
grep
(
$_
eq
'longdescs'
,
@tables
))
{
if
(
grep
(
$_
eq
'longdescs'
,
@tables
)
and
!
grep
(
$_
eq
'bugs_fulltext'
,
@tables
))
{
if
(
$self
->
bz_index_info_real
(
'longdescs'
,
'thetext'
))
{
if
(
$self
->
bz_index_info_real
(
'longdescs'
,
'thetext'
))
{
$self
->
bz_drop_index_raw
(
'longdescs'
,
'thetext'
);
$self
->
bz_drop_index_raw
(
'longdescs'
,
'thetext'
);
}
}
...
@@ -368,9 +368,8 @@ EOT
...
@@ -368,9 +368,8 @@ EOT
# Upgrade tables from MyISAM to InnoDB
# Upgrade tables from MyISAM to InnoDB
my
@myisam_tables
;
my
@myisam_tables
;
foreach
my
$row
(
@$table_status
)
{
foreach
my
$name
(
keys
%
table_status
)
{
my
(
$name
,
$type
)
=
@$row
;
if
(
$table_status
{
$name
}
=~
/^MYISAM$/i
if
(
$type
=~
/^MYISAM$/i
&&
!
grep
(
$_
eq
$name
,
Bugzilla::DB::Schema::Mysql::
MYISAM_TABLES
))
&&
!
grep
(
$_
eq
$name
,
Bugzilla::DB::Schema::Mysql::
MYISAM_TABLES
))
{
{
push
(
@myisam_tables
,
$name
)
;
push
(
@myisam_tables
,
$name
)
;
...
...
Bugzilla/Install/DB.pm
View file @
56c9e803
...
@@ -2340,10 +2340,11 @@ sub _initialize_dependency_tree_changes_email_pref {
...
@@ -2340,10 +2340,11 @@ sub _initialize_dependency_tree_changes_email_pref {
foreach
my
$desc
(
keys
%
events
)
{
foreach
my
$desc
(
keys
%
events
)
{
my
$event
=
$events
{
$desc
};
my
$event
=
$events
{
$desc
};
my
$sth
=
$dbh
->
prepare
(
"SELECT COUNT(*) FROM email_setting
my
$have_events
=
$dbh
->
selectrow_array
(
WHERE event = $event"
);
"SELECT 1 FROM email_setting WHERE event = $event "
$sth
->
execute
();
.
$dbh
->
sql_limit
(
1
));
if
(
!
(
$sth
->
fetchrow_arrayref
()
->
[
0
]))
{
if
(
!
$have_events
)
{
# No settings in the table yet, so we assume that this is the
# No settings in the table yet, so we assume that this is the
# first time it's being set.
# first time it's being set.
print
"Initializing \"$desc\" email_setting ...\n"
;
print
"Initializing \"$desc\" email_setting ...\n"
;
...
@@ -2901,11 +2902,8 @@ sub _initialize_workflow {
...
@@ -2901,11 +2902,8 @@ sub _initialize_workflow {
# and mark these statuses as 'closed', even if some of these statuses are
# and mark these statuses as 'closed', even if some of these statuses are
# expected to be open statuses. Bug statuses we have no information about
# expected to be open statuses. Bug statuses we have no information about
# are left as 'open'.
# are left as 'open'.
my
@closed_statuses
=
#
@
{
$dbh
->
selectcol_arrayref
(
'SELECT DISTINCT bug_status FROM bugs
# We append the default list of closed statuses *unless* we detect at least
WHERE resolution != ?'
,
undef
,
''
)};
# Append the default list of closed statuses *unless* we detect at least
# one closed state in the DB (i.e. with is_open = 0). This would mean that
# one closed state in the DB (i.e. with is_open = 0). This would mean that
# the DB has already been updated at least once and maybe the admin decided
# the DB has already been updated at least once and maybe the admin decided
# that e.g. 'RESOLVED' is now an open state, in which case we don't want to
# that e.g. 'RESOLVED' is now an open state, in which case we don't want to
...
@@ -2916,6 +2914,9 @@ sub _initialize_workflow {
...
@@ -2916,6 +2914,9 @@ sub _initialize_workflow {
WHERE is_open = 0'
);
WHERE is_open = 0'
);
if
(
!
$num_closed_states
)
{
if
(
!
$num_closed_states
)
{
my
@closed_statuses
=
@
{
$dbh
->
selectcol_arrayref
(
'SELECT DISTINCT bug_status FROM bugs
WHERE resolution != ?'
,
undef
,
''
)};
@closed_statuses
=
@closed_statuses
=
map
{
$dbh
->
quote
(
$_
)}
(
@closed_statuses
,
qw(RESOLVED VERIFIED CLOSED)
);
map
{
$dbh
->
quote
(
$_
)}
(
@closed_statuses
,
qw(RESOLVED VERIFIED CLOSED)
);
...
...
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