summaryrefslogtreecommitdiffstats
path: root/Bugzilla
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2009-08-07 23:45:31 +0200
committermkanat%bugzilla.org <>2009-08-07 23:45:31 +0200
commit9726fb767a8016e6205fbaf24492049b67fb74e3 (patch)
tree43b399784ee3f90f8d21ac8d81cb18b89c80d89a /Bugzilla
parentdb79da1e677e492afeadb9c7af89633fde1e2cfe (diff)
downloadbugzilla-9726fb767a8016e6205fbaf24492049b67fb74e3.tar.gz
bugzilla-9726fb767a8016e6205fbaf24492049b67fb74e3.tar.xz
The original patch for bug 508186 actually broke utf-8 conversion--the tables were converted, but the columns were not. This fixes it.
Diffstat (limited to 'Bugzilla')
-rw-r--r--Bugzilla/DB/Mysql.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm
index 54659f5b0..380448ba3 100644
--- a/Bugzilla/DB/Mysql.pm
+++ b/Bugzilla/DB/Mysql.pm
@@ -748,6 +748,8 @@ EOT
# right after the type, which will always come first.
my ($binary, $utf8) = ($sql_def, $sql_def);
my $type = $self->_bz_schema->convert_type($col_info->{TYPE});
+ $binary =~ s/(\Q$type\E)/$1 CHARACTER SET binary/;
+ $utf8 =~ s/(\Q$type\E)/$1 CHARACTER SET utf8/;
push(@binary_sql, "MODIFY COLUMN $name $binary");
push(@utf8_sql, "MODIFY COLUMN $name $utf8");
}
@@ -767,7 +769,8 @@ EOT
print "Converting the $table table to UTF-8...\n";
my $bin = "ALTER TABLE $table " . join(', ', @binary_sql);
- my $utf = "ALTER TABLE $table " . join(', ', @utf8_sql);
+ my $utf = "ALTER TABLE $table " . join(', ', @utf8_sql,
+ 'DEFAULT CHARACTER SET utf8');
$self->do($bin);
$self->do($utf);
@@ -776,8 +779,9 @@ EOT
$self->bz_add_index($table, $index, $indexes{$index});
}
}
-
- $self->do("ALTER TABLE $table DEFAULT CHARACTER SET utf8");
+ else {
+ $self->do("ALTER TABLE $table DEFAULT CHARACTER SET utf8");
+ }
} # foreach my $table (@tables)