[Rt-commit] rt branch, 4.2/warn-mysql-5.6-innodb, repushed

Alex Vandiver alexmv at bestpractical.com
Mon Apr 6 14:49:11 EDT 2015


The branch 4.2/warn-mysql-5.6-innodb was deleted and repushed:
       was 3e8cda519830d2c2ffc22f6a831111e999938ca6
       now 2011cc77ade3677a914dd48b3861ea0d5dffa39d

1:  4393822 ! 1:  aa41701 Warn if innodb_log_file_size would limit uploads to < 5M
    @@ -24,17 +24,19 @@
     -            my $max_packet = sprintf("%.1fM", $max_packet/1024/1024);
     -            warn "max_allowed_packet is set to $max_packet, which limits the maximum attachment or email size that RT can process.  Consider adjusting MySQL's max_allowed_packet setting.\n";
     +        if ($state =~ /^(create|post)$/) {
    -+            my $max_packet = ($dbh->selectrow_array("show variables like 'max_allowed_packet'"))[1];
    ++            my $show_var = sub { $dbh->selectrow_arrayref("SHOW VARIABLES LIKE ?",{},$_[0])->[1] };
    ++
    ++            my $max_packet = $show_var->("max_allowed_packet");
     +            if ($max_packet <= (1024 * 1024)) {
     +                $max_packet = sprintf("%.1fM", $max_packet/1024/1024);
     +                warn "max_allowed_packet is set to $max_packet, which limits the maximum attachment or email size that RT can process.  Consider adjusting MySQL's max_allowed_packet setting.\n";
     +            }
     +
    -+            my $full_version = ($dbh->selectrow_array("show variables like 'version'"))[1];
    -+            if ($full_version =~ /^5\.6\.(\d+)$/ and $1 >= 20) {
    -+                my $redo_log_size = ($dbh->selectrow_array("show variables like 'innodb_log_file_size'"))[1];
    -+                $redo_log_size *= ($dbh->selectrow_array("show variables like 'innodb_log_files_in_group'"))[1]
    -+                    if $full_version =~ /^5\.6\.(\d+)$/ and $1 >= 22;
    ++            my $full_version = $show_var->("version");
    ++            if ($full_version =~ /^5\.(\d+)\.(\d+)$/ and (($1 == 6 and $2 >= 20) or $1 > 6)) {
    ++                my $redo_log_size = $show_var->("innodb_log_file_size");
    ++                $redo_log_size *= $show_var->("innodb_log_files_in_group")
    ++                    if $full_version =~ /^5\.(\d+)\.(\d+)$/ and (($1 == 6 and $2 >= 22) or $1 > 6);
     +
     +                if ($redo_log_size / 10 < 5 * 1024 * 1024) {
     +                    $redo_log_size = sprintf("%.1fM",$redo_log_size/1024/1024);
-:  ------- > 2:  252b3b8 Refactor "SHOW CREATE TABLE" statements into a common local sub
2:  3e8cda5 ! 3:  2011cc7 Increase the warn threshold on max_allowed_packet to 5M
    @@ -10,9 +10,9 @@
     --- a/lib/RT/Handle.pm
     +++ b/lib/RT/Handle.pm
     @@
    +             my $show_var = sub { $dbh->selectrow_arrayref("SHOW VARIABLES LIKE ?",{},$_[0])->[1] };
      
    -         if ($state =~ /^(create|post)$/) {
    -             my $max_packet = ($dbh->selectrow_array("show variables like 'max_allowed_packet'"))[1];
    +             my $max_packet = $show_var->("max_allowed_packet");
     -            if ($max_packet <= (1024 * 1024)) {
     +            if ($max_packet <= (5 * 1024 * 1024)) {
                      $max_packet = sprintf("%.1fM", $max_packet/1024/1024);



More information about the rt-commit mailing list