X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FHandle.pm;h=b449d2037dacfd6dd2e81e75143637567f135d65;hb=679854b8bbc65d112071111bbd7f34a6a481fb30;hp=03c262bbade6ab7adae2bd581f07b32a1153fd3a;hpb=9b328d940af56b9924a342192ebb0790478fa705;p=freeside.git diff --git a/rt/lib/RT/Handle.pm b/rt/lib/RT/Handle.pm index 03c262bba..b449d2037 100644 --- a/rt/lib/RT/Handle.pm +++ b/rt/lib/RT/Handle.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -262,17 +262,19 @@ sub CheckCompatibility { unless $version; ($version) = $version =~ /^(\d+\.\d+)/; - return (0, "RT is unsupported on MySQL versions before 4.0.x, it's $version") - if $version < 4; + return (0, "RT is unsupported on MySQL versions before 4.1. Your version is $version.") + if $version < 4.1; # MySQL must have InnoDB support - my $innodb = ($dbh->selectrow_array("show variables like 'have_innodb'"))[1]; - if ( lc $innodb eq "no" ) { + local $dbh->{FetchHashKeyName} = 'NAME_lc'; + my $innodb = lc($dbh->selectall_hashref("SHOW ENGINES", "engine")->{InnoDB}{support} || "no"); + if ( $innodb eq "no" ) { return (0, "RT requires that MySQL be compiled with InnoDB table support.\n". - "See http://dev.mysql.com/doc/mysql/en/InnoDB.html"); - } elsif ( lc $innodb eq "disabled" ) { + "See \n". + "and check that there are no 'skip-innodb' lines in your my.cnf."); + } elsif ( $innodb eq "disabled" ) { return (0, "RT requires that MySQL InnoDB table support be enabled.\n". - "Remove the 'skip-innodb' line from your my.cnf file, restart MySQL, and try again.\n"); + "Remove the 'skip-innodb' or 'innodb = OFF' line from your my.cnf file, restart MySQL, and try again.\n"); } if ( $state eq 'post' ) { @@ -280,14 +282,19 @@ sub CheckCompatibility { unless ( $create_table =~ /(?:ENGINE|TYPE)\s*=\s*InnoDB/i ) { return (0, "RT requires that all its tables be of InnoDB type. Upgrade RT tables."); } - } - if ( $version >= 4.1 && $state eq 'post' ) { - my $create_table = $dbh->selectrow_arrayref("SHOW CREATE TABLE Attachments")->[1]; + + $create_table = $dbh->selectrow_arrayref("SHOW CREATE TABLE Attachments")->[1]; unless ( $create_table =~ /\bContent\b[^,]*BLOB/i ) { return (0, "RT since version 3.8 has new schema for MySQL versions after 4.1.0\n" ."Follow instructions in the UPGRADING.mysql file."); } } + + my $max_packet = ($dbh->selectrow_array("show variables like 'max_allowed_packet'"))[1]; + if ($state =~ /^(create|post)$/ and $max_packet <= (1024 * 1024)) { + 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"; + } } return (1) } @@ -578,7 +585,13 @@ sub cmp_version($$) { return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i]; } return 0; -}} +} + +sub version_words { + return keys %word; +} + +} =head2 InsertInitialData