summaryrefslogtreecommitdiffstats
path: root/Bugzilla/DB
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-08-18 21:42:56 +0200
committermkanat%bugzilla.org <>2009-08-18 21:42:56 +0200
commit56c9e8034aa591a50a7aa11dee2f7289e807c6f4 (patch)
tree0dd1005d64d621bee344d68599fd37dd4b0d44fa /Bugzilla/DB
parentdbfeceeba9f66601ff3145713cbb4050016b4411 (diff)
downloadbugzilla-56c9e8034aa591a50a7aa11dee2f7289e807c6f4.tar.gz
bugzilla-56c9e8034aa591a50a7aa11dee2f7289e807c6f4.tar.xz
Bug 507969: Speed up checksetup for cases when it's doing nothing
Patch by Max Kanat-Alexander <mkanat@bugzilla.org> r=LpSolit, a=mkanat
Diffstat (limited to 'Bugzilla/DB')
-rw-r--r--Bugzilla/DB/Mysql.pm25
1 files changed, 12 insertions, 13 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 380448ba3..39064e4e2 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -317,15 +317,11 @@ EOT
}
- # Figure out if any existing tables are of type ISAM and convert them
- # to type MyISAM if so. ISAM tables are deprecated in MySQL 3.23,
- # 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 %table_status = @{ $self->selectcol_arrayref("SHOW TABLE STATUS",
+ {Columns=>[1,2]}) };
my @isam_tables;
- foreach my $row (@$table_status) {
- my ($name, $type) = @$row;
- push(@isam_tables, $name) if $type eq "ISAM";
+ foreach my $name (keys %table_status) {
+ push(@isam_tables, $name) if $table_status{$name} eq "ISAM";
}
if(scalar(@isam_tables)) {
@@ -347,7 +343,9 @@ EOT
# 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
# 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')) {
$self->bz_drop_index_raw('bugs', 'short_desc');
}
@@ -356,7 +354,9 @@ EOT
$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')) {
$self->bz_drop_index_raw('longdescs', 'thetext');
}
@@ -368,9 +368,8 @@ EOT
# Upgrade tables from MyISAM to InnoDB
my @myisam_tables;
- foreach my $row (@$table_status) {
- my ($name, $type) = @$row;
- if ($type =~ /^MYISAM$/i
+ foreach my $name (keys %table_status) {
+ if ($table_status{$name} =~ /^MYISAM$/i
&& !grep($_ eq $name, Bugzilla::DB::Schema::Mysql::MYISAM_TABLES))
{
push(@myisam_tables, $name) ;