From: mkanat%bugzilla.org <> Date: Sun, 11 Mar 2007 09:07:13 +0000 (+0000) Subject: Bug 373511: InnoDB conversion can fail silently X-Git-Tag: bugzilla-3.1.2~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f7218dece9661ce08a760c92927e2101b546de7;p=thirdparty%2Fbugzilla.git Bug 373511: InnoDB conversion can fail silently Patch By Max Kanat-Alexander (module owner) a=mkanat --- diff --git a/Bugzilla/DB/Mysql.pm b/Bugzilla/DB/Mysql.pm index 2e8643fb04..582a2a7b8d 100644 --- a/Bugzilla/DB/Mysql.pm +++ b/Bugzilla/DB/Mysql.pm @@ -257,6 +257,24 @@ sub _bz_get_initial_schema { sub bz_setup_database { my ($self) = @_; + # Make sure the installation has InnoDB turned on, or we're going to be + # doing silly things like making foreign keys on MyISAM tables, which is + # hard to fix later. We do this up here because none of the code below + # works if InnoDB is off. (Particularly if we've already converted the + # tables to InnoDB.) + my ($innodb_on) = @{$self->selectcol_arrayref( + q{SHOW VARIABLES LIKE '%have_innodb%'}, {Columns=>[2]})}; + if ($innodb_on ne 'YES') { + print <