From a671f4ebe0f80686d9d98d51c754a07f4bb68d31 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 12 Jul 2018 18:20:25 -0400 Subject: Bug 1328659 - Add support for utf8=utf8mb4 (switches to dynamic/compressed row format, and changes charset to utf8mb4) --- Bugzilla/Config/Common.pm | 14 ++++++++------ Bugzilla/Config/General.pm | 5 +++-- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'Bugzilla/Config') diff --git a/Bugzilla/Config/Common.pm b/Bugzilla/Config/Common.pm index fabf7c880..24b636099 100644 --- a/Bugzilla/Config/Common.pm +++ b/Bugzilla/Config/Common.pm @@ -83,14 +83,16 @@ sub check_email { sub check_utf8 { - my $utf8 = shift; + my ($utf8, $entry) = @_; - # You cannot turn off the UTF-8 parameter if you've already converted - # your tables to utf-8. - my $dbh = Bugzilla->dbh; - if ( $dbh->isa('Bugzilla::DB::Mysql') && $dbh->bz_db_is_utf8 && !$utf8 ) { - return "You cannot disable UTF-8 support, because your MySQL database" . " is encoded in UTF-8"; + # You cannot turn off the UTF-8 parameter. + if ( !$utf8 ) { + return "You cannot disable UTF-8 support."; } + elsif ($entry eq 'utf8mb4' && $utf8 ne 'utf8mb4') { + return "You cannot disable UTF8-MB4 support."; + } + return ""; } diff --git a/Bugzilla/Config/General.pm b/Bugzilla/Config/General.pm index 9d85aecaf..15688dfd3 100644 --- a/Bugzilla/Config/General.pm +++ b/Bugzilla/Config/General.pm @@ -33,8 +33,9 @@ use constant get_param_list => ( { name => 'utf8', - type => 'b', - default => '0', + type => 's', + choices => [ '1', 'utf8', 'utf8mb4' ], + default => 'utf8', checker => \&check_utf8 }, -- cgit v1.2.3-24-g4f1b