[Rt-commit] rt branch, 4.0/mysql-innodb-check, created. rt-4.0.8-251-gd6aa0e8

Thomas Sibley trs at bestpractical.com
Thu Dec 13 21:05:55 EST 2012


The branch, 4.0/mysql-innodb-check has been created
        at  d6aa0e83a1fad0bbb0b47ff6d70e8e1a8941ff27 (commit)

- Log -----------------------------------------------------------------
commit 7f832319a46ba7abec96de2722eefa031d16a100
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Dec 13 17:44:26 2012 -0800

    Correct casing of MySQL

diff --git a/README b/README
index 37a6aff..a6f653a 100644
--- a/README
+++ b/README
@@ -25,7 +25,7 @@ o   Perl 5.8.3 or later (http://www.perl.org).
 
 o   A supported SQL database
 
-        Currently supported:  Mysql 4.1 or later with InnoDB support.
+        Currently supported:  MySQL 4.1 or later with InnoDB support.
                               Postgres 8.1 or later.
                               Oracle 9iR2 or later.
                               SQLite 3.0. (Not recommended for production)

commit 1a489946312aefb1c2f116140e7d08d6f5490ea0
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Dec 13 17:47:33 2012 -0800

    MySQL 4.0 is not supported on RT 4.0; MySQL 4.1 is the minimum required
    
    Combines two conditionals into one since they can both assume the
    MySQL version is >= 4.1.

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index 03c262b..a37f6ea 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -262,8 +262,8 @@ 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];
@@ -280,9 +280,8 @@ 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.");

commit d6aa0e83a1fad0bbb0b47ff6d70e8e1a8941ff27
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Dec 13 17:48:57 2012 -0800

    Check InnoDB support via SHOW ENGINES for MySQL 5.6 compatibility
    
    MySQL 5.6 (still in release candidate stage) drops the 'have_innodb'
    variable in favor of SHOW ENGINES.  The latter is supported since 4.1,
    so we can safely use it across the board.
    
    In my testing on 5.1, I never saw "disabled" when disabling InnoDB via
    'skip-innodb'.  SHOW ENGINES always reported "no" despite the engine
    being disabled at runtime not compile time.  Hint at this possibility in
    the error message for "no".

diff --git a/lib/RT/Handle.pm b/lib/RT/Handle.pm
index a37f6ea..cb55af61a 100644
--- a/lib/RT/Handle.pm
+++ b/lib/RT/Handle.pm
@@ -266,13 +266,15 @@ sub CheckCompatibility {
             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 <http://dev.mysql.com/doc/mysql/en/innodb-storage-engine.html>\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' ) {

-----------------------------------------------------------------------


More information about the Rt-commit mailing list