]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Synthesis #1: Adopt utf8mb4 and DBIx::Connector (#79)
authorDylan William Hardison <dylan@hardison.net>
Wed, 2 Oct 2019 20:28:37 +0000 (16:28 -0400)
committerGitHub <noreply@github.com>
Wed, 2 Oct 2019 20:28:37 +0000 (16:28 -0400)
* use base to make merging with bmo easier

* Revert "Bug 1497042 - Enclose table names in CREATE queries"

This reverts commit 62d5637a4c96abbcde6f308421d676a0336d8e25.

* refactor Bugzilla::DB to not subclass DBI

* use DBIx::Connector to manage database connections

* Ensure we always call DBIx::Connector->dbh before any DBI method

The code didn't allow a way of doing this without a lot of work.

So I had to take the following approach:
The 'dbh' attribute is now a method that delegates to DBIx::Connector's dbh
method. Per the docs, ->dbh() "Returns the connection's database handle. It will
use a an existing handle if there is one, if the process has not been forked or
a new thread spawned, and if the database is pingable. Otherwise, it will
instantiate, cache, and return a new handle."

Then there is the matter of the 'handles' on dbh. I've used Package::Stash to
insert proxy methods into the class when it is loaded.

* Bug 1328659 - Add support for utf8=utf8mb4 (switches to dynamic/compressed row format, and changes charset to utf8mb4)

* add deps

* add prepare_cached to the list of delegated methods.

This was added in bug 340160

* improve the migration to compressed/dynamic rows, skip views

* add missing semicolon

* remove pre-utf8mb4 emoji support

* fix small issue

* add debugging fatal error

126 files changed:
Bugzilla.pm
Bugzilla/Attachment.pm
Bugzilla/Auth/Login/CGI.pm
Bugzilla/Auth/Login/Env.pm
Bugzilla/Auth/Verify/DB.pm
Bugzilla/Auth/Verify/RADIUS.pm
Bugzilla/Bug.pm
Bugzilla/BugUrl.pm
Bugzilla/BugUrl/Bugzilla.pm
Bugzilla/BugUrl/Bugzilla/Local.pm
Bugzilla/BugUrl/Debian.pm
Bugzilla/BugUrl/GitHub.pm
Bugzilla/BugUrl/Google.pm
Bugzilla/BugUrl/JIRA.pm
Bugzilla/BugUrl/Launchpad.pm
Bugzilla/BugUrl/MantisBT.pm
Bugzilla/BugUrl/SourceForge.pm
Bugzilla/BugUrl/Trac.pm
Bugzilla/BugUserLastVisit.pm
Bugzilla/CGI.pm
Bugzilla/Classification.pm
Bugzilla/Comment.pm
Bugzilla/Comment/TagWeights.pm
Bugzilla/Component.pm
Bugzilla/Config.pm
Bugzilla/Config/Common.pm
Bugzilla/Config/General.pm
Bugzilla/Constants.pm
Bugzilla/DB.pm
Bugzilla/DB/Mysql.pm
Bugzilla/DB/Oracle.pm
Bugzilla/DB/Pg.pm
Bugzilla/DB/Schema/Mysql.pm
Bugzilla/DB/Schema/Oracle.pm
Bugzilla/DB/Schema/Pg.pm
Bugzilla/DB/Schema/Sqlite.pm
Bugzilla/DB/Sqlite.pm
Bugzilla/Error.pm
Bugzilla/Extension.pm
Bugzilla/Field.pm
Bugzilla/Field/Choice.pm
Bugzilla/Flag.pm
Bugzilla/FlagType.pm
Bugzilla/Group.pm
Bugzilla/Install/CPAN.pm
Bugzilla/Install/Filesystem.pm
Bugzilla/Install/Localconfig.pm
Bugzilla/Install/Requirements.pm
Bugzilla/Install/Util.pm
Bugzilla/Job/BugMail.pm
Bugzilla/Job/Mailer.pm
Bugzilla/JobQueue.pm
Bugzilla/JobQueue/Runner.pm
Bugzilla/Keyword.pm
Bugzilla/MIME.pm
Bugzilla/Mailer.pm
Bugzilla/Migrate/Gnats.pm
Bugzilla/Milestone.pm
Bugzilla/Product.pm
Bugzilla/RNG.pm
Bugzilla/Report.pm
Bugzilla/Search.pm
Bugzilla/Search/ClauseGroup.pm
Bugzilla/Search/Condition.pm
Bugzilla/Search/Quicksearch.pm
Bugzilla/Search/Recent.pm
Bugzilla/Search/Saved.pm
Bugzilla/Sender/Transport/Sendmail.pm
Bugzilla/Status.pm
Bugzilla/Template.pm
Bugzilla/Template/Context.pm
Bugzilla/Template/Plugin/Bugzilla.pm
Bugzilla/Template/Plugin/Hook.pm
Bugzilla/Token.pm
Bugzilla/User.pm
Bugzilla/User/APIKey.pm
Bugzilla/User/Setting.pm
Bugzilla/User/Setting/Lang.pm
Bugzilla/User/Setting/Skin.pm
Bugzilla/User/Setting/Timezone.pm
Bugzilla/UserAgent.pm
Bugzilla/Util.pm
Bugzilla/Version.pm
Bugzilla/WebService/Bug.pm
Bugzilla/WebService/BugUserLastVisit.pm
Bugzilla/WebService/Bugzilla.pm
Bugzilla/WebService/Classification.pm
Bugzilla/WebService/Constants.pm
Bugzilla/WebService/FlagType.pm
Bugzilla/WebService/Group.pm
Bugzilla/WebService/Product.pm
Bugzilla/WebService/Server/REST.pm
Bugzilla/WebService/Server/XMLRPC.pm
Bugzilla/WebService/User.pm
Bugzilla/WebService/Util.pm
Bugzilla/Whine.pm
Bugzilla/Whine/Query.pm
Bugzilla/Whine/Schedule.pm
docs/lib/Pod/Simple/HTML/Bugzilla.pm
docs/lib/Pod/Simple/HTMLBatch/Bugzilla.pm
extensions/BmpConvert/Extension.pm
extensions/Example/Extension.pm
extensions/Example/lib/Auth/Login.pm
extensions/Example/lib/Auth/Verify.pm
extensions/Example/lib/WebService.pm
extensions/MoreBugUrl/Extension.pm
extensions/MoreBugUrl/lib/BitBucket.pm
extensions/MoreBugUrl/lib/GetSatisfaction.pm
extensions/MoreBugUrl/lib/PHP.pm
extensions/MoreBugUrl/lib/RT.pm
extensions/MoreBugUrl/lib/Redmine.pm
extensions/MoreBugUrl/lib/ReviewBoard.pm
extensions/MoreBugUrl/lib/Rietveld.pm
extensions/MoreBugUrl/lib/Savane.pm
extensions/OldBugMove/Extension.pm
extensions/Voting/Extension.pm
t/Support/Systemexec.pm
t/Support/Templates.pm
template/en/default/setup/strings.txt.pl
xt/lib/Bugzilla/Test/Search/AndTest.pm
xt/lib/Bugzilla/Test/Search/Constants.pm
xt/lib/Bugzilla/Test/Search/CustomTest.pm
xt/lib/Bugzilla/Test/Search/FieldTestNormal.pm
xt/lib/Bugzilla/Test/Search/InjectionTest.pm
xt/lib/Bugzilla/Test/Search/NotTest.pm
xt/lib/Bugzilla/Test/Search/OrTest.pm

index deffa259eb75ce91dcb25684cb6fbe6109ef51fc..6e95ff727e615abcf70b8538cf2f3ba7c2c95698 100644 (file)
@@ -701,7 +701,6 @@ sub _cleanup {
   foreach my $dbh ($main, $shadow) {
     next if !$dbh;
     $dbh->bz_rollback_transaction() if $dbh->bz_in_transaction;
-    $dbh->disconnect;
   }
   my $smtp = $cache->{smtp};
   $smtp->disconnect if $smtp;
index 26f768c2ff8db157cccf01fdbf50ce3338e7ebf6..3a98b12437c72f0ef6798863674b3e453c217092 100644 (file)
@@ -48,7 +48,7 @@ use File::Copy;
 use List::Util qw(max);
 use Storable qw(dclone);
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 ###############################
 ####    Initialization     ####
index 0824f1ebd1571c62559c9222de7e7d45d274d6da..17b076d162405017d8296ae1b3b3504f5339bfa8 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Auth::Login);
+use base qw(Bugzilla::Auth::Login);
 use constant user_can_create_account => 1;
 
 use Bugzilla::Constants;
index 5fc33921bf3438f9b4763a4115dc26c7189660c7..4995fa0025cec4ea6b82a9c110806c778e7894e5 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Auth::Login);
+use base qw(Bugzilla::Auth::Login);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index 6ed9ba15c7801af8035771a1caa0513b33e9787a..cb89a35618fbaad9ef670c8f2dd25ccc724ebf6a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Auth::Verify);
+use base qw(Bugzilla::Auth::Verify);
 
 use Bugzilla::Constants;
 use Bugzilla::Token;
index 2cbde0404733b015d1d29b8c46728cd7d8ac06bc..a2a54b9445fd4ec6e4eb790e405dd11e0a65ecf3 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Auth::Verify);
+use base qw(Bugzilla::Auth::Verify);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index bce3661f1f2b1a1eafead1da240ed2184e4e35cc..ac549d40443a9d94b9390728735d9ad09d383ec8 100644 (file)
@@ -36,7 +36,7 @@ use List::Util qw(min max first);
 use Storable qw(dclone);
 use Scalar::Util qw(blessed);
 
-use parent qw(Bugzilla::Object Exporter);
+use base qw(Bugzilla::Object Exporter);
 @Bugzilla::Bug::EXPORT = qw(
   bug_alias_to_id
   LogActivityEntry
@@ -3755,17 +3755,6 @@ sub comments {
     foreach my $comment (@{$self->{'comments'}}) {
       $comment->{count} = $count++;
       $comment->{bug}   = $self;
-
-      # XXX - hack for MySQL. Convert [U+....] back into its Unicode
-      # equivalent for characters above U+FFFF as MySQL older than 5.5.3
-      # cannot store them, see Bugzilla::Comment::_check_thetext().
-      if ($is_mysql) {
-
-        # Perl 5.13.8 and older complain about non-characters.
-        no warnings 'utf8';
-        $comment->{thetext}
-          =~ s/\x{FDD0}\[U\+((?:[1-9A-F]|10)[0-9A-F]{4})\]\x{FDD1}/chr(hex $1)/eg;
-      }
     }
 
     # Some bugs may have no comments when upgrading old installations.
index c3e11e4c7eed80c58a1ee1657cb8784a2deb17b8..24a31b8e3fb028858af81f6015820a8b0f01874c 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Util;
 use Bugzilla::Error;
index 9d036100fa5ded904ec8e70b0c874959891b4e8a..1cedb1f561ec8e9e9f9b29ffac583e2f952b0a45 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 use Bugzilla::Error;
 use Bugzilla::Util;
index 3fe0fcb5db808f727babb259b72e32b29e4378f1..e74985eaf7c352065b1a483b94b08dc356acbb8a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl::Bugzilla);
+use base qw(Bugzilla::BugUrl::Bugzilla);
 
 use Bugzilla::Error;
 use Bugzilla::Util;
index f49f2b82027ca8a386a863ea78424a76e5860c06..488d8531152939233069abd78a9547384ad4e24d 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 583837a609e0185d19ea3633a74f2f57c094fe6f..a815648127dddab6e9bba67f54b3a7ea27a99b72 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 1064253029be359391362c4d6b8a81e91874fbb6..54c405730e80bacf126288ea15b577f18e38f846 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index b42b1deccff085cc3372573511a09fee94b610d3..6c49d7118418ceb08c31c75a580367f90a4957af 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 5be8088d196d1d30ff81e093c35b602a13a0c58c..a4ac1438245099de9af4545ad69aae6726909218 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 742ae1a47f2458597eb472baf3e73f4b5ccbb07e..58d3ad5fd092899868994f5c0067c30424fcc09a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index ffdde42f45d161d5e3e631b79411ce1313018321..0c2e6f412492e024d01d0d4e62572816392899f8 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 22418a1df5549a35b3128f1c213ab038686f77dc..c6678b3a9d4fa119d2da99ec015222dcb7e538a2 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index d1c351959df5e65b8d4ccf7ae7b50e017615d482..12b9df2c7c68bd01da5ecfb55ebd69b7099dfb73 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 #####################################################################
 # Overriden Constants that are used as methods
index 019fb8d10e26c8791fcdd18b3155f2b3d2f1f84f..5fc16db350f6461b57f1b36bd65c14f05a9c5f1c 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(CGI);
+use base qw(CGI);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index 1ea86f592c3bc0b9e2aa9b4d9d27a63004e7868c..d374a2454ea714f83177c4675df23da9361ff744 100644 (file)
@@ -17,7 +17,7 @@ use Bugzilla::Util;
 use Bugzilla::Error;
 use Bugzilla::Product;
 
-use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object Exporter);
+use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object Exporter);
 @Bugzilla::Classification::EXPORT = qw(sort_products_by_classification);
 
 ###############################
index 575703b4b2772440d7ae5ea54db228a24cdf7ff7..ab50add430868abb29a54c47fcf7c8b6f61865ad 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Attachment;
 use Bugzilla::Comment::TagWeights;
@@ -440,20 +440,6 @@ sub _check_thetext {
   $thetext =~ s/\s*$//s;
   $thetext =~ s/\r\n?/\n/g;    # Get rid of \r.
 
-  # Characters above U+FFFF cannot be stored by MySQL older than 5.5.3 as they
-  # require the new utf8mb4 character set. Other DB servers are handling them
-  # without any problem. So we need to replace these characters if we use MySQL,
-  # else the comment is truncated.
-  # XXX - Once we use utf8mb4 for comments, this hack for MySQL can go away.
-  state $is_mysql = Bugzilla->dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0;
-  if ($is_mysql) {
-
-    # Perl 5.13.8 and older complain about non-characters.
-    no warnings 'utf8';
-    $thetext
-      =~ s/([\x{10000}-\x{10FFFF}])/"\x{FDD0}[" . uc(sprintf('U+%04x', ord($1))) . "]\x{FDD1}"/eg;
-  }
-
   ThrowUserError('comment_too_long') if length($thetext) > MAX_COMMENT_LENGTH;
   return $thetext;
 }
index 5355cad7fb27afaa17c5b304dc56e5d5b48dab14..e733ed8fb788fbaa6679a7c9e0be6c7f625866a2 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 
index ef8180eb0e17cfd59691abd8f544fc6dae15f26f..707745627aa9d83cf0a7d01ec748a23aec6b75ce 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object);
+use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Util;
index 1aa944985b00c7202794b81772c6a3150714cd5f..635e49dfecc40ed56bf4f106a053c8d58d500717 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 use autodie qw(:default);
 
 use Bugzilla::Constants;
@@ -341,6 +341,8 @@ sub read_param_file {
     die "The $file file does not exist."
       . ' You probably need to run checksetup.pl.',;
   }
+  die "the param utf8 must be set to utf8mb4" unless $params{utf8} eq 'utf8mb4';
+  
   return \%params;
 }
 
index a0077b5b24ad637a7617a16d1bece1f5177c35f1..4b0c9db642344d10d2809d48de28d3d390aa7858 100644 (file)
@@ -20,7 +20,7 @@ use Bugzilla::Field;
 use Bugzilla::Group;
 use Bugzilla::Status;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 @Bugzilla::Config::Common::EXPORT
   = qw(check_multi check_numeric check_regexp check_url check_group
   check_sslbase check_priority check_severity check_platform
@@ -123,15 +123,16 @@ sub check_ip {
 }
 
 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 "";
 }
 
index 322275aa0ab74249d36ee480f209e8dcf933a970..37c648d3b7531578bc4e0858a915bafa10881813 100644 (file)
@@ -24,7 +24,13 @@ use constant get_param_list => (
     checker  => \&check_email
   },
 
-  {name => 'utf8', type => 'b', default => '0', checker => \&check_utf8},
+  {
+    name    => 'utf8',
+    type    => 's',
+    choices => ['1', 'utf8', 'utf8mb4'],
+    default => 'utf8',
+    checker => \&check_utf8
+  },
 
   {name => 'shutdownhtml', type => 'l', default => ''},
 
index a9a5e0eaac965250c562356d38e5f475560c7be1..a93658b856cf902d6c286ace2667bbc71ee5f2ec 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 # For bz_locations
 use File::Basename;
index c528e77d140aa051ad2490921081078f37d33256..092f870ca4909fce730b807d5d825f65651efa1e 100644 (file)
@@ -8,13 +8,13 @@
 package Bugzilla::DB;
 
 use 5.10.1;
-use strict;
-use warnings;
+use Moo;
 
 use DBI;
+use DBIx::Connector;
+our %Connector;
 
-# Inherit the DB class from DBI::db.
-use parent -norequire, qw(DBI::db);
+has 'connector' => (is => 'lazy', handles => [qw( dbh )],);
 
 use Bugzilla::Constants;
 use Bugzilla::Mailer;
@@ -29,6 +29,32 @@ use Bugzilla::Version;
 use List::Util qw(max);
 use Storable qw(dclone);
 
+has [qw(dsn user pass attrs)] => (is => 'ro', required => 1,);
+
+
+# Install proxy methods to the DBI object.
+# We can't use handles() as DBIx::Connector->dbh has to be called each
+# time we need a DBI handle to ensure the connection is alive.
+{
+  my @DBI_METHODS = qw(
+    begin_work column_info commit disconnect do errstr get_info last_insert_id
+    ping prepare prepare_cached primary_key quote_identifier rollback
+    selectall_arrayref selectall_hashref selectcol_arrayref selectrow_array
+    selectrow_arrayref selectrow_hashref table_info
+  );
+  my $stash = Package::Stash->new(__PACKAGE__);
+
+  foreach my $method (@DBI_METHODS) {
+    my $symbol = '&' . $method;
+    $stash->add_symbol(
+      $symbol => sub {
+        my $self = shift;
+        return $self->dbh->$method(@_);
+      }
+    );
+  }
+}
+
 #####################################################################
 # Constants
 #####################################################################
@@ -88,7 +114,7 @@ use constant INDEX_DROPS_REQUIRE_FK_DROPS => 1;
 
 sub quote {
   my $self   = shift;
-  my $retval = $self->SUPER::quote(@_);
+  my $retval = $self->dbh->quote(@_);
   trick_taint($retval) if defined $retval;
   return $retval;
 }
@@ -130,9 +156,7 @@ sub _connect {
     "'$driver' is not a valid choice for \$db_driver in " . " localconfig: " . $@);
 
   # instantiate the correct DB specific module
-  my $dbh = $pkg_module->new($params);
-
-  return $dbh;
+  return $pkg_module->new($params);
 }
 
 sub _handle_error {
@@ -200,7 +224,6 @@ sub bz_check_server_version {
   my ($self, $db, $output) = @_;
 
   my $sql_vers = $self->bz_server_version;
-  $self->disconnect;
 
   my $sql_want   = $db->{db_version};
   my $version_ok = vers_cmp($sql_vers, $sql_want) > -1 ? 1 : 0;
@@ -261,7 +284,6 @@ sub bz_create_database {
     }
   }
 
-  $dbh->disconnect;
 }
 
 # A helper for bz_create_database and bz_check_requirements.
@@ -270,6 +292,7 @@ sub _get_no_db_connection {
   my $dbh;
   my %connect_params = %{Bugzilla->localconfig};
   $connect_params{db_name} = '';
+  local %Connector = ();
   my $conn_success = eval { $dbh = _connect(\%connect_params); };
   if (!$conn_success) {
     my $driver     = $connect_params{db_driver};
@@ -1299,14 +1322,15 @@ sub bz_rollback_transaction {
 # Subclass Helpers
 #####################################################################
 
-sub db_new {
-  my ($class, $params) = @_;
-  my ($dsn, $user, $pass, $override_attrs) = @$params{qw(dsn user pass attrs)};
+sub _build_connector {
+  my ($self) = @_;
+  my ($dsn, $user, $pass, $override_attrs)
+    = map { $self->$_ } qw(dsn user pass attrs);
 
   # set up default attributes used to connect to the database
   # (may be overridden by DB driver implementations)
   my $attributes = {
-    RaiseError         => 0,
+    RaiseError         => 1,
     AutoCommit         => 1,
     PrintError         => 0,
     ShowErrorStatement => 1,
@@ -1323,20 +1347,14 @@ sub db_new {
       $attributes->{$key} = $override_attrs->{$key};
     }
   }
+  my $class = ref $self;
+  if ($class->can('on_dbi_connected')) {
+    $attributes->{Callbacks}
+      = {connected => sub { $class->on_dbi_connected(@_); return },};
+  }
 
-  # connect using our known info to the specified db
-  my $self = DBI->connect($dsn, $user, $pass, $attributes)
-    or die "\nCan't connect to the database.\nError: $DBI::errstr\n"
-    . "  Is your database installed and up and running?\n  Do you have"
-    . " the correct username and password selected in localconfig?\n\n";
-
-  # RaiseError was only set to 0 so that we could catch the
-  # above "die" condition.
-  $self->{RaiseError} = 1;
-
-  bless($self, $class);
-
-  return $self;
+  return $Connector{"$user.$dsn"}
+    //= DBIx::Connector->new($dsn, $user, $pass, $attributes);
 }
 
 #####################################################################
index a58d88df4b8b380b8731f014cfa35855e353afc1..0e0a017fecb05a2e3ea2660ff6bc88e43f015a98 100644 (file)
@@ -22,10 +22,9 @@ For interface details see L<Bugzilla::DB> and L<DBI>.
 package Bugzilla::DB::Mysql;
 
 use 5.10.1;
-use strict;
-use warnings;
+use Moo;
 
-use parent qw(Bugzilla::DB);
+extends qw(Bugzilla::DB);
 
 use Bugzilla::Constants;
 use Bugzilla::Install::Util qw(install_string);
@@ -33,8 +32,9 @@ use Bugzilla::Util;
 use Bugzilla::Error;
 use Bugzilla::DB::Schema::Mysql;
 
-use List::Util qw(max);
+use List::Util qw(max any);
 use Text::ParseWords;
+use Carp;
 
 # This is how many comments of MAX_COMMENT_LENGTH we expect on a single bug.
 # In reality, you could have a LOT more comments than this, because
@@ -43,7 +43,7 @@ use constant MAX_COMMENTS => 50;
 
 use constant FULLTEXT_OR => '|';
 
-sub new {
+sub BUILDARGS {
   my ($class, $params) = @_;
   my ($user, $pass, $host, $dbname, $port, $sock)
     = @$params{qw(db_user db_pass db_host db_name db_port db_sock)};
@@ -53,12 +53,7 @@ sub new {
   $dsn .= ";port=$port"         if $port;
   $dsn .= ";mysql_socket=$sock" if $sock;
 
-  my %attrs = (
-    mysql_enable_utf8 => Bugzilla->params->{'utf8'},
-
-    # Needs to be explicitly specified for command-line processes.
-    mysql_auto_reconnect => 1,
-  );
+  my %attrs = (mysql_enable_utf8 => 1);
 
   # MySQL SSL options
   my ($ssl_ca_file, $ssl_ca_path, $ssl_cert, $ssl_key) = @$params{
@@ -73,25 +68,21 @@ sub new {
     $attrs{'mysql_ssl_client_key'}  = $ssl_key if $ssl_key;
   }
 
-  my $self = $class->db_new(
-    {dsn => $dsn, user => $user, pass => $pass, attrs => \%attrs});
+  return {dsn => $dsn, user => $user, pass => $pass, attrs => \%attrs};
+}
+
+sub on_dbi_connected {
+  my ($class, $dbh) = @_;
 
   # This makes sure that if the tables are encoded as UTF-8, we
   # return their data correctly.
-  $self->do("SET NAMES utf8") if Bugzilla->params->{'utf8'};
-
-  # all class local variables stored in DBI derived class needs to have
-  # a prefix 'private_'. See DBI documentation.
-  $self->{private_bz_tables_locked} = "";
-
-  # Needed by TheSchwartz
-  $self->{private_bz_dsn} = $dsn;
-
-  bless($self, $class);
+  my $charset = $class->utf8_charset;
+  my $collate = $class->utf8_collate;
+  $dbh->do("SET NAMES $charset COLLATE $collate");
 
   # Check for MySQL modes.
   my ($var, $sql_mode)
-    = $self->selectrow_array("SHOW VARIABLES LIKE 'sql\\_mode'");
+    = $dbh->selectrow_array("SHOW VARIABLES LIKE 'sql\\_mode'");
 
   # Disable ANSI and strict modes, else Bugzilla will crash.
   if ($sql_mode) {
@@ -104,19 +95,17 @@ sub new {
         split(/,/, $sql_mode));
 
     if ($sql_mode ne $new_sql_mode) {
-      $self->do("SET SESSION sql_mode = ?", undef, $new_sql_mode);
+      $dbh->do("SET SESSION sql_mode = ?", undef, $new_sql_mode);
     }
   }
 
   # Allow large GROUP_CONCATs (largely for inserting comments
   # into bugs_fulltext).
-  $self->do('SET SESSION group_concat_max_len = 128000000');
+  $dbh->do('SET SESSION group_concat_max_len = 128000000');
 
   # MySQL 5.5.2 and older have this variable set to true, which causes
   # trouble, see bug 870369.
-  $self->do('SET SESSION sql_auto_is_null = 0');
-
-  return $self;
+  $dbh->do('SET SESSION sql_auto_is_null = 0');
 }
 
 # when last_insert_id() is supported on MySQL by lowest DBI/DBD version
@@ -346,6 +335,34 @@ sub bz_setup_database {
     die install_string('mysql_innodb_disabled');
   }
 
+  if ($self->utf8_charset eq 'utf8mb4') {
+    my %global = map {@$_}
+      @{$self->selectall_arrayref(q(SHOW GLOBAL VARIABLES LIKE 'innodb_%'))};
+    my $utf8mb4_supported
+      = $global{innodb_file_format} eq 'Barracuda'
+      && $global{innodb_file_per_table} eq 'ON'
+      && $global{innodb_large_prefix} eq 'ON';
+
+    die install_string('mysql_innodb_settings') unless $utf8mb4_supported;
+
+    my $tables = $self->selectall_arrayref('SHOW TABLE STATUS');
+    foreach my $table_status (@$tables) {
+      my ($table, undef, undef, $row_format) = @$table_status;
+      my $table_type = $table_status->[-1];
+      my $new_row_format = $self->default_row_format($table);
+      next if lc($table_type) eq 'view';
+      next if lc($new_row_format) eq 'compact';
+      next if lc($row_format) eq 'dynamic';
+      next if lc($row_format) eq 'compressed';
+      if (lc($new_row_format) ne lc($row_format)) {
+        print install_string(
+          'mysql_row_format_conversion', {table => $table, format => $new_row_format}
+          ),
+          "\n";
+        $self->do(sprintf 'ALTER TABLE %s ROW_FORMAT=%s', $table, $new_row_format);
+      }
+    }
+  }
 
   my ($sd_index_deleted, $longdescs_index_deleted);
   my @tables = $self->bz_table_list_real();
@@ -379,9 +396,6 @@ sub bz_setup_database {
     'SELECT TABLE_NAME FROM information_schema.TABLES 
           WHERE TABLE_SCHEMA = ? AND ENGINE = ?', undef, $db_name, 'MyISAM'
   );
-  foreach my $should_be_myisam (Bugzilla::DB::Schema::Mysql::MYISAM_TABLES) {
-    @$myisam_tables = grep { $_ ne $should_be_myisam } @$myisam_tables;
-  }
 
   if (scalar @$myisam_tables) {
     print "Bugzilla now uses the InnoDB storage engine in MySQL for",
@@ -564,10 +578,7 @@ sub bz_setup_database {
   # This kind of situation happens when people create the database
   # themselves, and if we don't do this they will get the big
   # scary WARNING statement about conversion to UTF8.
-  if ( !$self->bz_db_is_utf8
-    && !@tables
-    && (Bugzilla->params->{'utf8'} || !scalar keys %{Bugzilla->params}))
-  {
+  unless ($self->bz_db_is_utf8) {
     $self->_alter_db_charset_to_utf8();
   }
 
@@ -678,11 +689,13 @@ sub bz_setup_database {
   # the table charsets.
   #
   # TABLE_COLLATION IS NOT NULL prevents us from trying to convert views.
+  my $charset         = $self->utf8_charset;
+  my $collate         = $self->utf8_collate;
   my $non_utf8_tables = $self->selectrow_array(
     "SELECT 1 FROM information_schema.TABLES 
           WHERE TABLE_SCHEMA = ? AND TABLE_COLLATION IS NOT NULL 
-                AND TABLE_COLLATION NOT LIKE 'utf8%' 
-          LIMIT 1", undef, $db_name
+                AND TABLE_COLLATION != ?
+          LIMIT 1", undef, $db_name, $collate
   );
 
   if (Bugzilla->params->{'utf8'} && $non_utf8_tables) {
@@ -698,7 +711,8 @@ sub bz_setup_database {
       }
     }
 
-    print "Converting table storage format to UTF-8. This may take a", " while.\n";
+    print
+      "Converting table storage format to $charset (collate $collate). This may take a while.\n";
     foreach my $table ($self->bz_table_list_real) {
       my $info_sth = $self->prepare("SHOW FULL COLUMNS FROM $table");
       $info_sth->execute();
@@ -712,11 +726,11 @@ sub bz_setup_database {
         # If this particular column isn't stored in utf-8
         if ( $column->{Collation}
           && $column->{Collation} ne 'NULL'
-          && $column->{Collation} !~ /utf8/)
+          && $column->{Collation} ne $collate)
         {
           my $name = $column->{Field};
 
-          print "$table.$name needs to be converted to UTF-8...\n";
+          print "$table.$name needs to be converted to $charset (collate $collate)...\n";
 
           # These will be automatically re-created at the end
           # of checksetup.
@@ -737,7 +751,7 @@ sub bz_setup_database {
           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/;
+          $utf8   =~ s/(\Q$type\E)/$1 CHARACTER SET $charset COLLATE $collate/;
           push(@binary_sql, "MODIFY COLUMN $name $binary");
           push(@utf8_sql,   "MODIFY COLUMN $name $utf8");
         }
@@ -757,8 +771,8 @@ sub bz_setup_database {
 
         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, 'DEFAULT CHARACTER SET utf8');
+        my $utf = "ALTER TABLE $table "
+          . join(', ', @utf8_sql, "DEFAULT CHARACTER SET $charset COLLATE $collate");
         $self->do($bin);
         $self->do($utf);
 
@@ -768,7 +782,7 @@ sub bz_setup_database {
         }
       }
       else {
-        $self->do("ALTER TABLE $table DEFAULT CHARACTER SET utf8");
+        $self->do("ALTER TABLE $table DEFAULT CHARACTER SET $charset COLLATE $collate");
       }
 
     }    # foreach my $table (@tables)
@@ -779,7 +793,7 @@ sub bz_setup_database {
   # a mysqldump.) So we have this change outside of the above block,
   # so that it just happens silently if no actual *table* conversion
   # needs to happen.
-  if (Bugzilla->params->{'utf8'} && !$self->bz_db_is_utf8) {
+  unless ($self->bz_db_is_utf8) {
     $self->_alter_db_charset_to_utf8();
   }
 
@@ -861,19 +875,70 @@ sub _fix_defaults {
   }
 }
 
+sub utf8_charset {
+  return 'utf8' unless Bugzilla->params->{'utf8'};
+  return Bugzilla->params->{'utf8'} eq 'utf8mb4' ? 'utf8mb4' : 'utf8';
+}
+
+sub utf8_collate {
+  my $charset = utf8_charset();
+  if ($charset eq 'utf8') {
+    return 'utf8_general_ci';
+  }
+  elsif ($charset eq 'utf8mb4') {
+    return 'utf8mb4_unicode_520_ci';
+  }
+  else {
+    croak "invalid charset: $charset";
+  }
+}
+
+sub default_row_format {
+  my ($class, $table) = @_;
+  my $charset = utf8_charset();
+  if ($charset eq 'utf8') {
+    return 'Compact';
+  }
+  elsif ($charset eq 'utf8mb4') {
+    my @no_compress = qw(
+      bug_user_last_visit
+      cc
+      email_rates
+      logincookies
+      token_data
+      tokens
+      ts_error
+      ts_exitstatus
+      ts_funcmap
+      ts_job
+      ts_note
+      user_request_log
+      votes
+    );
+    return 'Dynamic' if any { $table eq $_ } @no_compress;
+    return 'Compressed';
+  }
+  else {
+    croak "invalid charset: $charset";
+  }
+}
+
 sub _alter_db_charset_to_utf8 {
   my $self    = shift;
   my $db_name = Bugzilla->localconfig->{db_name};
-  $self->do("ALTER DATABASE $db_name CHARACTER SET utf8");
+  my $charset = $self->utf8_charset;
+  my $collate = $self->utf8_collate;
+  $self->do("ALTER DATABASE $db_name CHARACTER SET $charset COLLATE $collate");
 }
 
 sub bz_db_is_utf8 {
   my $self = shift;
-  my $db_collation
+  my $db_charset
     = $self->selectrow_arrayref("SHOW VARIABLES LIKE 'character_set_database'");
 
   # First column holds the variable name, second column holds the value.
-  return $db_collation->[1] =~ /utf8/ ? 1 : 0;
+  my $charset = $self->utf8_charset;
+  return $db_charset->[1] eq $charset ? 1 : 0;
 }
 
 
index 930270ccc7611924c406fcf65b62430577f6cd45..73ffb4b455803fc3c0d87c8a931243292f4f1081 100644 (file)
@@ -22,10 +22,9 @@ For interface details see L<Bugzilla::DB> and L<DBI>.
 package Bugzilla::DB::Oracle;
 
 use 5.10.1;
-use strict;
-use warnings;
+use Moo;
 
-use parent qw(Bugzilla::DB);
+extends qw(Bugzilla::DB);
 
 use DBD::Oracle;
 use DBD::Oracle qw(:ora_types);
@@ -46,7 +45,7 @@ use constant BLOB_TYPE       => {ora_type => ORA_BLOB};
 use constant MIN_LONG_READ_LEN => 32 * 1024;
 use constant FULLTEXT_OR       => ' OR ';
 
-sub new {
+sub BUILDARGS {
   my ($class, $params) = @_;
   my ($user, $pass, $host, $dbname, $port)
     = @$params{qw(db_user db_pass db_host db_name db_port)};
@@ -66,24 +65,21 @@ sub new {
     LongReadLen =>
       max(Bugzilla->params->{'maxattachmentsize'} || 0, MIN_LONG_READ_LEN) * 1024,
   };
-  my $self = $class->db_new(
-    {dsn => $dsn, user => $user, pass => $pass, attrs => $attrs});
-
-  # Needed by TheSchwartz
-  $self->{private_bz_dsn} = $dsn;
+  return {dsn => $dsn, user => $user, pass => $pass, attrs => $attrs};
+}
 
-  bless($self, $class);
+sub on_dbi_connected {
+  my ($class, $dbh) = @_;
 
   # Set the session's default date format to match MySQL
-  $self->do("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
-  $self->do("ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'");
-  $self->do("ALTER SESSION SET NLS_LENGTH_SEMANTICS='CHAR'")
+  $dbh->do("ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'");
+  $dbh->do("ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'");
+  $dbh->do("ALTER SESSION SET NLS_LENGTH_SEMANTICS='CHAR'")
     if Bugzilla->params->{'utf8'};
 
   # To allow case insensitive query.
-  $self->do("ALTER SESSION SET NLS_COMP='ANSI'");
-  $self->do("ALTER SESSION SET NLS_SORT='BINARY_AI'");
-  return $self;
+  $dbh->do("ALTER SESSION SET NLS_COMP='ANSI'");
+  $dbh->do("ALTER SESSION SET NLS_SORT='BINARY_AI'");
 }
 
 sub bz_last_key {
@@ -752,7 +748,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent -norequire, qw(DBI::st);
+use base -norequire, qw(DBI::st);
 
 sub fetchrow_arrayref {
   my $self = shift;
index 15a268381ce288f2f185b84064cc3ac1ca354550..ec4bf3f46568721cdef2e08d698d72851ba782a1 100644 (file)
@@ -22,19 +22,18 @@ For interface details see L<Bugzilla::DB> and L<DBI>.
 package Bugzilla::DB::Pg;
 
 use 5.10.1;
-use strict;
-use warnings;
+use Moo;
 
 use Bugzilla::Error;
 use Bugzilla::Version;
 use DBD::Pg;
 
 # This module extends the DB interface via inheritance
-use parent qw(Bugzilla::DB);
+extends qw(Bugzilla::DB);
 
 use constant BLOB_TYPE => {pg_type => DBD::Pg::PG_BYTEA};
 
-sub new {
+sub BUILDARGS {
   my ($class, $params) = @_;
   my ($user, $pass, $host, $dbname, $port)
     = @$params{qw(db_user db_pass db_host db_name db_port)};
@@ -55,19 +54,7 @@ sub new {
 
   my $attrs = {pg_enable_utf8 => Bugzilla->params->{'utf8'}};
 
-  my $self = $class->db_new(
-    {dsn => $dsn, user => $user, pass => $pass, attrs => $attrs});
-
-  # all class local variables stored in DBI derived class needs to have
-  # a prefix 'private_'. See DBI documentation.
-  $self->{private_bz_tables_locked} = "";
-
-  # Needed by TheSchwartz
-  $self->{private_bz_dsn} = $dsn;
-
-  bless($self, $class);
-
-  return $self;
+  return {dsn => $dsn, user => $user, pass => $pass, attrs => $attrs};
 }
 
 # if last_insert_id is supported on PostgreSQL by lowest DBI/DBD version
index 4c0d43523d3a8fdb5dd22c14abb24925c1c2777f..3ca54549d3d3d29df8ea8f3fbf0a4d31ac390eff 100644 (file)
@@ -19,7 +19,7 @@ use warnings;
 
 use Bugzilla::Error;
 
-use parent qw(Bugzilla::DB::Schema);
+use base qw(Bugzilla::DB::Schema);
 
 # This is for column_info_to_column, to know when a tinyint is a
 # boolean and when it's really a tinyint. This only has to be accurate
@@ -85,8 +85,6 @@ use constant REVERSE_MAPPING => {
   # as in their db-specific version, so no reverse mapping is needed.
 };
 
-use constant MYISAM_TABLES => qw();
-
 #------------------------------------------------------------------------------
 sub _initialize {
 
@@ -128,20 +126,16 @@ sub _initialize {
 #------------------------------------------------------------------------------
 sub _get_create_table_ddl {
 
-  # Extend superclass method to specify the MYISAM storage engine.
   # Returns a "create table" SQL statement.
-
   my ($self, $table) = @_;
-
-  my $charset = Bugzilla->dbh->bz_db_is_utf8 ? "CHARACTER SET utf8" : '';
-  my $type = grep($_ eq $table, MYISAM_TABLES) ? 'MYISAM' : 'InnoDB';
-
-  my $ddl = $self->SUPER::_get_create_table_ddl($table);
-  $ddl =~ s/CREATE TABLE (.*) \(/CREATE TABLE `$1` (/;
-  $ddl .= " ENGINE = $type $charset";
-
-  return $ddl;
-
+  my $charset    = Bugzilla::DB::Mysql->utf8_charset;
+  my $collate    = Bugzilla::DB::Mysql->utf8_collate;
+  my $row_format = Bugzilla::DB::Mysql->default_row_format($table);
+  my @parts      = (
+    $self->SUPER::_get_create_table_ddl($table), 'ENGINE = InnoDB',
+    "CHARACTER SET $charset COLLATE $collate",   "ROW_FORMAT=$row_format",
+  );
+  return join(' ', @parts);
 }    #eosub--_get_create_table_ddl
 
 #------------------------------------------------------------------------------
@@ -155,7 +149,7 @@ sub _get_create_index_ddl {
   my $sql = "CREATE ";
   $sql .= "$index_type "
     if ($index_type eq 'UNIQUE' || $index_type eq 'FULLTEXT');
-  $sql .= "INDEX \`$index_name\` ON \`$table_name\` \("
+  $sql .= "INDEX \`$index_name\` ON $table_name \("
     . join(", ", @$index_fields) . "\)";
 
   return ($sql);
@@ -169,10 +163,9 @@ sub get_create_database_sql {
 
   # We only create as utf8 if we have no params (meaning we're doing
   # a new installation) or if the utf8 param is on.
-  my $create_utf8
-    = Bugzilla->params->{'utf8'} || !defined Bugzilla->params->{'utf8'};
-  my $charset = $create_utf8 ? "CHARACTER SET utf8" : '';
-  return ("CREATE DATABASE $name $charset");
+  my $charset = Bugzilla::DB::Mysql->utf8_charset;
+  my $collate = Bugzilla::DB::Mysql->utf8_collate;
+  return ("CREATE DATABASE $name CHARACTER SET $charset COLLATE $collate");
 }
 
 # MySQL has a simpler ALTER TABLE syntax than ANSI.
index 416e9204b5b2ea1f8f3964eb543c0cd2a9332581..3f589b337851782ecbc23461c22f9bd0c1442bdf 100644 (file)
@@ -17,7 +17,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::DB::Schema);
+use base qw(Bugzilla::DB::Schema);
 use Carp qw(confess);
 use Bugzilla::Util;
 
index cf28a02d966f207ff5d075340dc4e3009fdabb70..908ad86924736382427efd406ff7c97bed0d353c 100644 (file)
@@ -17,7 +17,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::DB::Schema);
+use base qw(Bugzilla::DB::Schema);
 use Storable qw(dclone);
 
 #------------------------------------------------------------------------------
index 57361d2bbfcc1cfe508e92d4b87233103f55aa2c..5173ae3bd8a761abf1670b35439d75aa8e77f85b 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::DB::Schema);
+use base qw(Bugzilla::DB::Schema);
 
 use Bugzilla::Error;
 use Bugzilla::Util qw(generate_random_password);
index c180fd0d76ca63468a9cee86009d7aded10ab8c8..26741c4dee0e7f727aa46c59f8e7128a3b9aa0be 100644 (file)
@@ -8,10 +8,9 @@
 package Bugzilla::DB::Sqlite;
 
 use 5.10.1;
-use strict;
-use warnings;
+use Moo;
 
-use parent qw(Bugzilla::DB);
+extends qw(Bugzilla::DB);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
@@ -69,7 +68,7 @@ sub _sqlite_position_ci {
 # Constructor #
 ###############
 
-sub new {
+sub BUILDARGS {
   my ($class, $params) = @_;
   my $db_name = $params->{db_name};
 
@@ -99,11 +98,11 @@ sub new {
     sqlite_unicode => Bugzilla->params->{'utf8'},
   };
 
-  my $self
-    = $class->db_new({dsn => $dsn, user => '', pass => '', attrs => $attrs});
+  return {dsn => $dsn, user => '', pass => '', attrs => $attrs};
+}
 
-  # Needed by TheSchwartz
-  $self->{private_bz_dsn} = $dsn;
+sub on_dbi_connected {
+  my ($class, $dbh) = @_;
 
   my %pragmas = (
 
@@ -129,12 +128,12 @@ sub new {
   );
 
   while (my ($name, $value) = each %pragmas) {
-    $self->do("PRAGMA $name = $value");
+    $dbh->do("PRAGMA $name = $value");
   }
 
-  $self->sqlite_create_collation('bugzilla', \&_sqlite_collate_ci);
-  $self->sqlite_create_function('position',  2, \&_sqlite_position);
-  $self->sqlite_create_function('iposition', 2, \&_sqlite_position_ci);
+  $dbh->sqlite_create_collation('bugzilla', \&_sqlite_collate_ci);
+  $dbh->sqlite_create_function('position',  2, \&_sqlite_position);
+  $dbh->sqlite_create_function('iposition', 2, \&_sqlite_position_ci);
 
   # SQLite has a "substr" function, but other DBs call it "SUBSTRING"
   # so that's what we use, and I don't know of any way in SQLite to
index ac56b9b027e48b6139784b5dcf1ab8c7f062a4c3..42b2dea04b607cb861b16e1cb28d56a132c2a4c6 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 @Bugzilla::Error::EXPORT = qw(ThrowCodeError ThrowTemplateError ThrowUserError);
 
index a5522583e9adba00fda1b81d82a9bff7f52ade42..4e01b5d9c97e9d9e1f5adb73d50b532dad1626cc 100644 (file)
@@ -245,7 +245,7 @@ F<extensions/Foo.pm>:
 
  package Bugzilla::Extension::Foo
  use strict;
- use parent qw(Bugzilla::Extension);
+ use base qw(Bugzilla::Extension);
 
  our $VERSION = '0.02';
  use constant NAME => 'Foo';
index 97013af513c0e369aa06032339ea354d2252f5d4..6b38e4d3afc8b71b09b7c61f75c08a7977942e38 100644 (file)
@@ -61,7 +61,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter Bugzilla::Object);
+use base qw(Exporter Bugzilla::Object);
 @Bugzilla::Field::EXPORT = qw(check_field get_field_id get_legal_field_values);
 
 use Bugzilla::Constants;
index bd82a8e3f0b2ed156f35ffe0b81f96d931d2bd40..b96af2187f3deac5fec4d07694dee6ff34cb881f 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object);
+use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object);
 
 use Bugzilla::Config qw(SetParam write_params);
 use Bugzilla::Constants;
@@ -99,7 +99,7 @@ sub type {
   if (!defined *{"${package}::DB_TABLE"}) {
     eval <<EOC;
             package $package;
-            use parent qw(Bugzilla::Field::Choice);
+            use base qw(Bugzilla::Field::Choice);
             use constant DB_TABLE => '$field_name';
 EOC
   }
index fb43d306bcd42a8802dd6c139a639662904f22f9..969e8bc706409f67ebea4b439fa4bd25911abd48 100644 (file)
@@ -51,7 +51,7 @@ use Bugzilla::Mailer;
 use Bugzilla::Constants;
 use Bugzilla::Field;
 
-use parent qw(Bugzilla::Object Exporter);
+use base qw(Bugzilla::Object Exporter);
 @Bugzilla::Flag::EXPORT = qw(SKIP_REQUESTEE_ON_ERROR);
 
 ###############################
index a08ee83b90bd9a080a6d1f83ae493c7cbc401661..ade62c115026b8f95dc9954a1b0c8f15470db124 100644 (file)
@@ -43,7 +43,7 @@ use Bugzilla::Group;
 use Email::Address;
 use List::MoreUtils qw(uniq);
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 ###############################
 ####    Initialization     ####
index 8715c4cfeba607c0bb8b2d64ff9765e098d0d78f..3763e74fcba74ca7d7c103c2d30830366b39bfe0 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Util;
index 4321cac619cc7c96f87d48debde6eb28961cd9ea..dd6db28daf160a8650552685b0b5edaa03d123ac 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 our @EXPORT = qw(
   BZ_LIB
 
index 8d61632235b1873f80cce5351f54baead99351e3..406e46bda919e0e90674a42496957c1676b27101 100644 (file)
@@ -34,7 +34,7 @@ use File::Spec;
 use IO::File;
 use POSIX ();
 
-use parent qw(Exporter);
+use base qw(Exporter);
 our @EXPORT = qw(
   update_filesystem
   create_htaccess
index bc45573098b71260fdd638dc8da47944073df080..e06a517488d9611cc20d7bd1660a97e80ba7e863 100644 (file)
@@ -28,7 +28,7 @@ use File::Basename qw(dirname);
 use Safe;
 use Term::ANSIColor;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 our @EXPORT_OK = qw(
   read_localconfig
index 852f7f78e04ef6b9618addb1140accedf2522065..83a1c5b7a8ba38fcde9ab4c9e915a3fff2642a93 100644 (file)
@@ -23,7 +23,7 @@ use Bugzilla::Install::Util qw(install_string bin_loc
 use List::Util qw(max);
 use Term::ANSIColor;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 our @EXPORT = qw(
   REQUIRED_MODULES
   OPTIONAL_MODULES
@@ -64,11 +64,11 @@ use constant APACHE => qw(apachectl httpd apache2 apache);
 # If we don't find any of the above binaries in the normal PATH,
 # these are extra places we look.
 use constant APACHE_PATH => [qw(
-    /usr/sbin
-    /usr/local/sbin
-    /usr/libexec
-    /usr/local/libexec
-    )];
+  /usr/sbin
+  /usr/local/sbin
+  /usr/libexec
+  /usr/local/libexec
+)];
 
 # The below two constants are subroutines so that they can implement
 # a hook. Other than that they are actually constants.
@@ -114,6 +114,10 @@ sub REQUIRED_MODULES {
       version => ($^V >= v5.13.3) ? '1.614' : '1.54'
     },
 
+    {package => 'DBIx-Connector', module => 'DBIx::Connector', version => '0.56',},
+
+    {package => 'Moo', module => 'Moo', version => '2.003004',},
+
     # 2.24 contains several useful text virtual methods.
     {package => 'Template-Toolkit', module => 'Template', version => '2.24'},
 
@@ -747,7 +751,7 @@ sub have_vers {
   my $blacklisted;
   if ($vok && $params->{blacklist}) {
     $blacklisted = grep($vnum =~ /$_/, @{$params->{blacklist}});
-    $vok = 0 if $blacklisted;
+    $vok         = 0 if $blacklisted;
   }
 
   if ($output) {
index 61797724159583fc52b20db3a6921869ee671f58..4c4957c770a1e525131c63c8ebe92db9d7123f0d 100644 (file)
@@ -25,7 +25,7 @@ use Scalar::Util qw(tainted);
 use Term::ANSIColor qw(colored);
 use PerlIO;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 our @EXPORT_OK = qw(
   bin_loc
   get_version_and_os
index a6deb577710b1f635b14219c069ce1b1f1330df9..157fd2971a3495f6502df6df98fe699dfdb14e2d 100644 (file)
@@ -12,7 +12,7 @@ use strict;
 use warnings;
 
 use Bugzilla::BugMail;
-BEGIN { eval "use parent qw(Bugzilla::Job::Mailer)"; }
+BEGIN { eval "use base qw(Bugzilla::Job::Mailer)"; }
 
 sub work {
   my ($class, $job) = @_;
index 544d86107bdbb46e22963035ad4df82c4b8d20a1..c2f1fea11e2337f748f4ace2978bb15e565344f1 100644 (file)
@@ -12,7 +12,7 @@ use strict;
 use warnings;
 
 use Bugzilla::Mailer;
-BEGIN { eval "use parent qw(TheSchwartz::Worker)"; }
+BEGIN { eval "use base qw(TheSchwartz::Worker)"; }
 
 # The longest we expect a job to possibly take, in seconds.
 use constant grab_for => 300;
index e481820078fd2f8bb749edff20e036cc5ca004cd..4777e6b0cae0c5acae0f71c35180e0957b83fe7d 100644 (file)
@@ -56,7 +56,7 @@ sub new {
   # to write to it.
   my $self = $class->SUPER::new(
     databases => [{
-      dsn    => Bugzilla->dbh_main->{private_bz_dsn},
+      dsn    => Bugzilla->dbh_main->dsn,
       user   => $lc->{db_user},
       pass   => $lc->{db_pass},
       prefix => 'ts_',
index a9eb0bca4932b254c7dbc074b9de5ef010782922..d339d498b74681b44687494a0d4c2000fdc93aa1 100644 (file)
@@ -23,7 +23,7 @@ use Pod::Usage;
 use Bugzilla::Constants;
 use Bugzilla::JobQueue;
 use Bugzilla::Util qw(get_text);
-BEGIN { eval "use parent qw(Daemon::Generic)"; }
+BEGIN { eval "use base qw(Daemon::Generic)"; }
 
 our $VERSION = BUGZILLA_VERSION;
 
index f1cb6cadf166386531c45ce59cedf1b19166cf17..5c17e5797e6c7e696022e1e5c011b9c9fe2ed056 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Error;
 use Bugzilla::Util;
index 660799e661a18e923ae3f6174ed876e255076e72..6df7ce2b2917773f3cb35f27dd4dda97eaaa5e6e 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Email::MIME);
+use base qw(Email::MIME);
 
 sub new {
   my ($class, $msg) = @_;
index a5f79b9bcc44d7427b94f007d000ea91bc20c2e4..0783bbf16ab252d69b60ccffddb80822836f1734 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 @Bugzilla::Mailer::EXPORT = qw(MessageToMTA build_thread_marker generate_email);
 
 use Bugzilla::Constants;
index a5aa642e148bd42070af10ee61154a878a8e3f7d..a8c26bd30d44a7bb60a92c1a76fccbc3550a7617 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Migrate);
+use base qw(Bugzilla::Migrate);
 
 use Bugzilla::Constants;
 use Bugzilla::Install::Util qw(indicate_progress);
index 815a111f804e9f93dd8b9fd78611a01649b4e26f..8b9288410d9f88927a1c53be9ab655a4c07a81fb 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Util;
index 2b39c2819fca579ae25320e8996aabd2ee2c9ce6..f826386ca9e918cfc526470322cfdaf3d7f87b1a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object);
+use base qw(Bugzilla::Field::ChoiceInterface Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Util;
index b92cbd7204bb2bfd761efc7fea05ef289fbcb73c..37ac937a298dab11444a3dd8556973f5828531b6 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 use Bugzilla::Constants qw(ON_WINDOWS);
 
 use Math::Random::ISAAC;
index 84ea3b38b3ff68235ebf4389308dfa3007314cf4..1d44e03ddeaa0ecd31b186bfd47806fa2cb901b2 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::CGI;
 use Bugzilla::Constants;
index 2005fe4db862c0b80c39ccd46c67bbecc565466f..017e8540690cdeda91a4c32f12beacd6f550bf30 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 @Bugzilla::Search::EXPORT = qw(
   IsValidQueryType
   split_order_term
@@ -1790,7 +1790,6 @@ sub _handle_chart {
   $field = FIELD_MAP->{$field} || $field;
 
   my ($string_value, $orig_value);
-  state $is_mysql = $dbh->isa('Bugzilla::DB::Mysql') ? 1 : 0;
 
   if (ref $value eq 'ARRAY') {
 
@@ -1799,17 +1798,11 @@ sub _handle_chart {
     @$value = grep { defined $_ and $_ ne '' } @$value;
     return if !@$value;
     $orig_value = join(',', @$value);
-    if ($field eq 'longdesc' && $is_mysql) {
-      @$value = map { _convert_unicode_characters($_) } @$value;
-    }
     $string_value = join(',', @$value);
   }
   else {
     return if $value eq '';
     $orig_value = $value;
-    if ($field eq 'longdesc' && $is_mysql) {
-      $value = _convert_unicode_characters($value);
-    }
     $string_value = $value;
   }
 
@@ -1870,19 +1863,6 @@ sub _handle_chart {
   $condition->translated(\%search_args);
 }
 
-# XXX - This is a hack for MySQL which doesn't understand Unicode characters
-# above U+FFFF, see Bugzilla::Comment::_check_thetext(). This hack can go away
-# once we require MySQL 5.5.3 and use utf8mb4.
-sub _convert_unicode_characters {
-  my $string = shift;
-
-  # Perl 5.13.8 and older complain about non-characters.
-  no warnings 'utf8';
-  $string
-    =~ s/([\x{10000}-\x{10FFFF}])/"\x{FDD0}[" . uc(sprintf('U+%04x', ord($1))) . "]\x{FDD1}"/eg;
-  return $string;
-}
-
 ##################################
 # do_search_function And Helpers #
 ##################################
index 5c77917346d581aa70f62c613cab0857158c6716..deecb0ce353d72a545e6ab885eefdae2758602c3 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Search::Clause);
+use base qw(Bugzilla::Search::Clause);
 
 use Bugzilla::Error;
 use Bugzilla::Search::Condition qw(condition);
index 9ddb6a89863c6a6a9b18467498932bd21e66a58a..36c6c11f2eecbabcd26fe2508111c7a46cca458a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 our @EXPORT_OK = qw(condition);
 
 sub new {
index 85cb2770f31ca610049e9d7252f988e2c16f58fc..1a9e462f6feb20c5f5410fb5ca0ce580e8c7dd1d 100644 (file)
@@ -22,7 +22,7 @@ use List::Util qw(min max);
 use List::MoreUtils qw(firstidx);
 use Text::ParseWords qw(parse_line);
 
-use parent qw(Exporter);
+use base qw(Exporter);
 @Bugzilla::Search::Quicksearch::EXPORT = qw(quicksearch);
 
 # Custom mappings for some fields.
index 5c12db15609060b9a780edfbc8d508ac2e2496cc..3a5d9f244bc58710119a34472f875bfc3a272c6d 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index c988e8997c65a3e0bc9bf6e5f28e5afada75bd9f..72ff822f55edcc3c8282eca62cb4ff7bf0fa3d78 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::CGI;
 use Bugzilla::Constants;
index d2be2cded97898609b7b937df004356ad9418b34..2c08304b9809c3ba3c8c26ccb0f425a8b0407e48 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Email::Sender::Transport::Sendmail);
+use base qw(Email::Sender::Transport::Sendmail);
 
 use Email::Sender::Failure;
 
index 615c7b2501a9ed02774f4cab7f9ccd90a6f68b39..a318de7295b9aa3e618abd94c3aa0bf735805d7a 100644 (file)
@@ -15,7 +15,7 @@ use warnings;
 # ChoiceInterface, because a bug status literally is a special type
 # of Field::Choice, not just an object that happens to have the same
 # methods.
-use parent qw(Bugzilla::Field::Choice Exporter);
+use base qw(Bugzilla::Field::Choice Exporter);
 @Bugzilla::Status::EXPORT = qw(
   BUG_STATE_OPEN
   SPECIAL_STATUS_WORKFLOW_ACTIONS
index ea319b4f06312a126583e43e611067f0c7bcad40..dfe8069fe567fa3fda683ac9dfe4b85bc0a8b95e 100644 (file)
@@ -37,7 +37,7 @@ use IO::Dir;
 use List::MoreUtils qw(firstidx);
 use Scalar::Util qw(blessed);
 
-use parent qw(Template);
+use base qw(Template);
 
 use constant FORMAT_TRIPLE => '%19s|%-28s|%-28s';
 use constant FORMAT_3_SIZE => [19, 28, 28];
index 01c8c598118ea410711fc6dc60da682b3507b076..bbd7a01c513ecd8a92c81a86fa486a1819c0bb36 100644 (file)
@@ -12,7 +12,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Template::Context);
+use base qw(Template::Context);
 
 use Bugzilla::Hook;
 use Scalar::Util qw(blessed);
index 0734fb9425caab41c1b36ba54cc166b310a8a865..b076a9d7c0e435954d3c798e803d651611067ddd 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Template::Plugin);
+use base qw(Template::Plugin);
 
 use Bugzilla;
 
index c57db4223681bccf685b1d80b7f76117ff983c4e..fddb989c03bb7369ae7d4d90941c4a15ee0c911b 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Template::Plugin);
+use base qw(Template::Plugin);
 
 use Bugzilla::Constants;
 use Bugzilla::Install::Util qw(template_include_path);
index 62106c5e54a54a43dcb3056fbd1f42ce7f30626a..81455e5ab3282ceabe0159bf2b56f72aa4e3cc8a 100644 (file)
@@ -22,7 +22,7 @@ use Date::Parse;
 use File::Basename;
 use Digest::SHA qw(hmac_sha256_base64);
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 @Bugzilla::Token::EXPORT = qw(issue_api_token issue_session_token
   check_token_data delete_token
index 5426cc8fa50cbebd56906014763b83521f2cf723..bec81dadc041fd08c55da14f20678231c8f28a4c 100644 (file)
@@ -31,7 +31,7 @@ use Storable qw(dclone);
 use URI;
 use URI::QueryParam;
 
-use parent qw(Bugzilla::Object Exporter);
+use base qw(Bugzilla::Object Exporter);
 @Bugzilla::User::EXPORT = qw(is_available_username
   login_to_id validate_password validate_password_check
   USER_MATCH_MULTIPLE USER_MATCH_FAILED USER_MATCH_SUCCESS
index d2e337c5ea18e3d8e7ccb10d504c91c87c224929..d9a9b16ac8f2b619a92d6c57ea2cbce6e153c02b 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::User;
 use Bugzilla::Util qw(generate_random_password trim);
index 67f5c568440dccbcb6a8198f036188f282791690..0f528e94666bd852e975de142ac148bd2d7f3a91 100644 (file)
@@ -12,7 +12,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 
 # Module stuff
index d1aeb342165fcd2daf9a8301d17b702dd6855cae..5f49bc6e4d479e0c026acd34c88d772b421cd8d5 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::User::Setting);
+use base qw(Bugzilla::User::Setting);
 
 use Bugzilla::Constants;
 
index 0447b02ab642479b3f7874e0201b9ac68dd1dce0..c28a44221ebe2f9bc35226bf665d20d0878ffe85 100644 (file)
@@ -12,7 +12,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::User::Setting);
+use base qw(Bugzilla::User::Setting);
 
 use Bugzilla::Constants;
 use File::Spec::Functions;
index b6b2503b5dde08b4f81ab764ddc6f690c59ab233..6e20f1fc272fd4058e4a784b41ffd5d9d1ea7a64 100644 (file)
@@ -13,7 +13,7 @@ use warnings;
 
 use DateTime::TimeZone;
 
-use parent qw(Bugzilla::User::Setting);
+use base qw(Bugzilla::User::Setting);
 
 use Bugzilla::Constants;
 
index 1995cc82ff54abf4cbecb5c02d4aa063d447f9ad..6a531136b93fcd49e1ed16739644a17d47c6b5d0 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 our @EXPORT = qw(detect_platform detect_op_sys);
 
 use Bugzilla::Field;
index 57247977785691301c4e66da71d81a5d1f11d6a7..ae85ff389ceab263cc2a3d5e5c5fbed8646ee602 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 @Bugzilla::Util::EXPORT = qw(trick_taint detaint_natural detaint_signed
   html_quote url_quote xml_quote
   css_class_quote html_light_quote
index dfc5a8e0f20aeb1b3e92ace7698860df19a93300..f4e90d5cad29801b933b06fa1f6f1b98baf56190 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object Exporter);
+use base qw(Bugzilla::Object Exporter);
 
 @Bugzilla::Version::EXPORT = qw(vers_cmp);
 
index 5852928c1ad05de9d6ae0bf970bef1800c1c6faf..5e366670be3e6c7aeccd3d6ff1be70efaa890379 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 
 use Bugzilla::Comment;
 use Bugzilla::Comment::TagWeights;
index 1285073764adf2f36b8ba68276457ded18edb605..3937f32d9975d723df66a9ad3804f6b7f42d8c77 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 
 use Bugzilla::Bug;
 use Bugzilla::Error;
index f93892068abef9effad1998c40d61ab81f646b80..23e0348915aeed97b8be818a7d70869cc76332bb 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 use Bugzilla::Constants;
 use Bugzilla::Util qw(datetime_from);
 use Bugzilla::WebService::Util qw(validate filter_wants);
index ab539b3395435246b74162f1ac3a31bd5a5910aa..525b8e679225fb43a077039b86ff127d645d3d30 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw (Bugzilla::WebService);
+use base qw (Bugzilla::WebService);
 
 use Bugzilla::Classification;
 use Bugzilla::Error;
index a2f83f528bbdeff3e30a5cf1f0a552d47eb4fe81..74ca897924dfc081230e602250587c6b9c713508 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 our @EXPORT = qw(
   WS_ERROR_CODE
index 9dc240c7f7f8b2d183751beb265a7678d805c39a..a9515eb7a6c63acdc5849043d0dd8d78a5acdbc6 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 use Bugzilla::Component;
 use Bugzilla::Constants;
 use Bugzilla::Error;
index c92583d0b1f0f8619aec7557c592b11ec208a459..4467883a4eb3340c5a75fff9141358c65d1d19f6 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 use Bugzilla::Constants;
 use Bugzilla::Error;
 use Bugzilla::WebService::Util qw(validate translate params_to_objects);
index a7980172e9d2dffd7238b8dc28119a0356255875..350dadde353171954319513f79a536c83295d366 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 use Bugzilla::Product;
 use Bugzilla::User;
 use Bugzilla::Error;
index 143b938b6524e9aabdca14c5629e34debbd19045..70cd82efef42dcf1a54f3bbbc9e4a30e9d8c3111 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService::Server::JSONRPC);
+use base qw(Bugzilla::WebService::Server::JSONRPC);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index f96f960da3a8ce9594c40c2dc04cc2bb93b8feb8..0e48b0572592fc5f9ef20f98b28d0e6d8cac359f 100644 (file)
@@ -132,7 +132,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-# We can't use "use parent" because XMLRPC::Serializer doesn't return
+# We can't use "use base" because XMLRPC::Serializer doesn't return
 # a true value.
 use XMLRPC::Lite;
 our @ISA = qw(XMLRPC::Deserializer);
@@ -287,7 +287,7 @@ use warnings;
 
 use Scalar::Util qw(blessed reftype);
 
-# We can't use "use parent" because XMLRPC::Serializer doesn't return
+# We can't use "use base" because XMLRPC::Serializer doesn't return
 # a true value.
 use XMLRPC::Lite;
 our @ISA = qw(XMLRPC::Serializer);
index 5910218318b12f4592b6872f4b133d007e5101b0..2078cc9a3d072e7d3b673a1748c6bdd49b9fa7a1 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index 3e70921b37c8b4bcf813e43b09e23da3b8158dd1..2b7e3de72259dd00ae0e9ae3a5b8210da13203f2 100644 (file)
@@ -18,7 +18,7 @@ use Bugzilla::Error;
 use Storable qw(dclone);
 use List::MoreUtils qw(any none);
 
-use parent qw(Exporter);
+use base qw(Exporter);
 
 # We have to "require", not "use" this, because otherwise it tries to
 # use features of Test::More during import().
index 081933cba0cc770bb0122159b2bd23273f3d38b7..67fc6cc5d682bd0c5a17727750de28ddc75306ef 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index 6648eab66697332e5be693bd679e6e18501411c0..95b0ab6f17da724d8dfa2bb5cde1d7bb3d8974cc 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 use Bugzilla::Search::Saved;
index 7517a3f26e1ef4e69b3c341bb13bb7ef134f003f..84b901b58d4c33cc4254c94dabdfcda5dccb2fae 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Object);
+use base qw(Bugzilla::Object);
 
 use Bugzilla::Constants;
 
index 5a2203473eb54c97354df39c50cd38d7a74bbda7..c95b031cfa130803811d41b11a528b581b653a33 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Pod::Simple::HTML);
+use base qw(Pod::Simple::HTML);
 
 # Without this constant, HTMLBatch will throw undef warnings.
 use constant VERSION    => $Pod::Simple::HTML::VERSION;
index bc96c9a0e711539feae301042d668b84554d4e3e..d800e176e1695efbe6c4e0eb678631cbabf5e3b3 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Pod::Simple::HTMLBatch);
+use base qw(Pod::Simple::HTMLBatch);
 
 # This is the same hack that HTMLBatch does to "import" this subroutine.
 BEGIN { *esc = \&Pod::Simple::HTML::esc }
index 84a2c81dcf6c18babd63a536b2aa60950538556e..313a734fe039df54c18e862b3631e238b225de47 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Extension);
+use base qw(Bugzilla::Extension);
 
 use Image::Magick;
 
index 1ecb3e692f7a46567106f870d377a22e5e66807a..227c13265846feee222accc066babeb61cad7de9 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Extension);
+use base qw(Bugzilla::Extension);
 
 use Bugzilla::Constants;
 use Bugzilla::Error;
index 49af42c2205504136e6ef3ce3cd5c50c766cad53..6f3a19f3ae152bc8223fccd18c3d930ad75bc5d2 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Auth::Login);
+use base qw(Bugzilla::Auth::Login);
 use constant user_can_create_account => 0;
 use Bugzilla::Constants;
 
index 591c1d4f8f8a57b25a8f45a8a78d873dc8038d34..b82f09d11daf9fbc8de26610d9f69571932bb500 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Auth::Verify);
+use base qw(Bugzilla::Auth::Verify);
 use Bugzilla::Constants;
 
 # A verifier that always fails.
index f461fee6f8a2bfdf8114cba5c664e63d6cb7acc7..f50c6e6cb5f4f1fce61241ccf1a0c7e5e146f487 100644 (file)
@@ -10,7 +10,7 @@ package Bugzilla::Extension::Example::WebService;
 use 5.10.1;
 use strict;
 use warnings;
-use parent qw(Bugzilla::WebService);
+use base qw(Bugzilla::WebService);
 use Bugzilla::Error;
 
 use constant PUBLIC_METHODS => qw(
index a6eae1be53e5c48ac5832add5bbf52a32a9f489a..c32a2469826aecfd3bb8e4a7c13502684c11458a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Extension);
+use base qw(Bugzilla::Extension);
 
 use constant MORE_SUB_CLASSES => qw(
   Bugzilla::Extension::MoreBugUrl::BitBucket
index 683f9aeb30b58e11f73e1dba1ff307196ae84356..9b3073564839e890be9cb7e14680bddf0b85016d 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 34c86b65f35bd5165c1e44dd5d7990b97923da28..d69a6c736c69374c5f6b56f769c2ee6d65e7ae6c 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 9419bcd148d18e2bbd10fd08c70cd6b198e5c64c..29fcc662f5903b7150c84f4c4e797c268e8fee2f 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 54dc2dd4ce60e72a8c4edced0723857760408174..52aab48d1faae327d86f00ec6ff2efdbca0c5b4b 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 712dab1971051c587ee73271ff8e5ddc270b6243..577d08bbb24a266f10b9b6018b413d74fb85a06f 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 48cbecf1170faebe8d138b64548e4294525887a9..49c904523e21b8f1aaa75e382500800b3e66507e 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 55a18b0b27c72a9934a34475fead6c7d088a6929..de3cafefa9eb2a2171a608ed4d6dbd420f9245e6 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index ff0cd657f804739040eb5ae0fddbfccc67cd46bf..a0ea2f825a040a4bd0dfdd4bc5cf7791b65e667a 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::BugUrl);
+use base qw(Bugzilla::BugUrl);
 
 ###############################
 ####        Methods        ####
index 70dc5ad3007c4cf74145fddbf7c6859d90e917b3..135b8546920bbb2926c312603a0800702eef85de 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Extension);
+use base qw(Bugzilla::Extension);
 use Bugzilla::Constants;
 use Bugzilla::Error;
 use Bugzilla::Field::Choice;
index a46162ed2af155029ee80474cc9b4dba3bead99a..7beefb990f73943f0a12e6b5452bd6a61dd65205 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Bugzilla::Extension);
+use base qw(Bugzilla::Extension);
 
 use Bugzilla::Bug;
 use Bugzilla::BugMail;
index e73763f8f01183b073ee6933056be76161ffd339..d5e0f91b1eac75594b4c5c10dbe75ac173564ed2 100644 (file)
@@ -11,7 +11,7 @@ use 5.10.1;
 use strict;
 use warnings;
 
-use parent qw(Exporter);
+use base qw(Exporter);
 @Support::Systemexec::EXPORT = qw(system exec);
 
 sub system($$@) {
index e08686e0fb86345fdd97fd0d2058ee0c4c68fe1a..3e186b589613725815da911d3564fee005f6e45d 100644 (file)
@@ -12,7 +12,7 @@ use strict;
 use warnings;
 
 use lib 't';
-use parent qw(Exporter);
+use base qw(Exporter);
 @Support::Templates::EXPORT
   = qw(@languages @include_paths @english_default_include_paths
   @referenced_files %actual_files $num_actual_files);
index 0efc378bbd6630c24c64bbc0a1abd17347c2ef58..94e9a5c35d42f4dbf1f9f02943b17925f3c79f7f 100644 (file)
@@ -335,6 +335,12 @@ EOT
 InnoDB is disabled in your MySQL installation.
 Bugzilla requires InnoDB to be enabled.
 Please enable it and then re-run checksetup.pl.
+END
+  mysql_innodb_settings => <<'END',
+Bugzilla requires the following MySQL InnoDB settings:
+innodb_file_format = Barracuda
+innodb_file_per_table = 1
+innodb_large_prefix = 1
 END
   mysql_index_renaming => <<'END',
 We are about to rename old indexes. The estimated time to complete
@@ -342,7 +348,8 @@ renaming is ##minutes## minutes. You cannot interrupt this action once
 it has begun. If you would like to cancel, press Ctrl-C now...
 (Waiting 45 seconds...)
 END
-  mysql_utf8_conversion => <<'END',
+  mysql_row_format_conversion => "Converting ##table## to row format ##format##.",
+  mysql_utf8_conversion       => <<'END',
 WARNING: We are about to convert your table storage format to UTF-8. This
          allows Bugzilla to correctly store and sort international characters.
          However, if you have any non-UTF-8 data in your database,
index 6132c0eb69f00c78c8fe2e44cd540f55cb7b16e0..8df566836d6942953b6b4715ef1585929f9b91c2 100644 (file)
@@ -8,7 +8,7 @@
 # This test combines two field/operator combinations using AND in
 # a single boolean chart.
 package Bugzilla::Test::Search::AndTest;
-use parent qw(Bugzilla::Test::Search::OrTest);
+use base qw(Bugzilla::Test::Search::OrTest);
 
 use Bugzilla::Test::Search::Constants;
 use List::MoreUtils qw(all);
index 84080cfe8b90f7c5358ef52a54122c57260f2190..1b8768f68fd7059b977db66c94328b094ecd2752 100644 (file)
@@ -12,7 +12,7 @@
 # More detailed information on each constant is available in the comments
 # in this file.
 package Bugzilla::Test::Search::Constants;
-use parent qw(Exporter);
+use base qw(Exporter);
 use Bugzilla::Constants;
 use Bugzilla::Util qw(generate_random_password);
 
index 7455d48282ef47c16465961742d3a026892e0697..14fc4454fe1f92a6f085ec0af36f045d5cb8a0cc 100644 (file)
@@ -9,7 +9,7 @@
 # Tests like this are specified in CUSTOM_SEARCH_TESTS in
 # Bugzilla::Test::Search::Constants.
 package Bugzilla::Test::Search::CustomTest;
-use parent qw(Bugzilla::Test::Search::FieldTest);
+use base qw(Bugzilla::Test::Search::FieldTest);
 use strict;
 use warnings;
 
index 101c090539f22f2ea6298fa87776a436d4699067..51e353eb37c655e909c80079d3ed332659c48f28 100644 (file)
@@ -10,7 +10,7 @@
 package Bugzilla::Test::Search::FieldTestNormal;
 use strict;
 use warnings;
-use parent qw(Bugzilla::Test::Search::FieldTest);
+use base qw(Bugzilla::Test::Search::FieldTest);
 
 use Scalar::Util qw(blessed);
 
index f34acc6bb5686440a5d3227ec8afb342022968a0..090841e87c29cf069e7ceccf52f9eead4a62ced0 100644 (file)
@@ -8,7 +8,7 @@
 # This module represents the SQL Injection tests that get run on a single
 # operator/field combination for Bugzilla::Test::Search.
 package Bugzilla::Test::Search::InjectionTest;
-use parent qw(Bugzilla::Test::Search::FieldTest);
+use base qw(Bugzilla::Test::Search::FieldTest);
 
 use strict;
 use warnings;
index ea0ecc5b2c1594149a88e2be01f565baac22c800..07367960dfdf693ac778d85e4a5554e45bc5736e 100644 (file)
@@ -12,7 +12,7 @@
 # it to OrTest and AndTest, but without Moose there isn't much of an
 # easy way to do that.
 package Bugzilla::Test::Search::NotTest;
-use parent qw(Bugzilla::Test::Search::FieldTest);
+use base qw(Bugzilla::Test::Search::FieldTest);
 use strict;
 use warnings;
 use Bugzilla::Test::Search::Constants;
index ebb16089d1b13010ab1fb0629039165c44e8afd7..82b4aac6900014d3b97e55650e83e9d5b7618467 100644 (file)
@@ -8,7 +8,7 @@
 # This test combines two field/operator combinations using OR in
 # a single boolean chart.
 package Bugzilla::Test::Search::OrTest;
-use parent qw(Bugzilla::Test::Search::FieldTest);
+use base qw(Bugzilla::Test::Search::FieldTest);
 
 use Bugzilla::Test::Search::Constants;
 use List::MoreUtils qw(all any uniq);