Commit 26f4337c authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Fix for Bug 399370: bugs_fulltext couldn't be converted to utf8, because it had…

Fix for Bug 399370: bugs_fulltext couldn't be converted to utf8, because it had fulltext indexes on it. Patch By Max Kanat-Alexander <mkanat@bugzilla.org> (module owner)
parent dc0d63e1
......@@ -640,8 +640,7 @@ EOT
my $name = $column->{Field};
# The code below doesn't work on a field with a FULLTEXT
# index. So we drop it. The upgrade code will re-create
# it later.
# index. So we drop it, which we'd do later anyway.
if ($table eq 'longdescs' && $name eq 'thetext') {
$self->bz_drop_index('longdescs',
'longdescs_thetext_idx');
......@@ -649,6 +648,14 @@ EOT
if ($table eq 'bugs' && $name eq 'short_desc') {
$self->bz_drop_index('bugs', 'bugs_short_desc_idx');
}
my %ft_indexes;
if ($table eq 'bugs_fulltext') {
%ft_indexes = $self->_bz_real_schema->get_indexes_on_column_abstract(
'bugs_fulltext', $name);
foreach my $index (keys %ft_indexes) {
$self->bz_drop_index('bugs_fulltext', $index);
}
}
print "Converting $table.$name to be stored as UTF-8...\n";
my $col_info =
......@@ -672,6 +679,13 @@ EOT
$binary");
$self->do("ALTER TABLE $table CHANGE COLUMN $name $name
$utf8");
if ($table eq 'bugs_fulltext') {
foreach my $index (keys %ft_indexes) {
$self->bz_add_index('bugs_fulltext', $index,
$ft_indexes{$index});
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment