1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 14:00:56 +01:00

Detect missing InnoDB in MySQL

Summary: See T993. MySQL fails very very softly if you request an engine which does not exist. Detect and fail if the InnoDB engine is missing or broken.

Test Plan: Faked InnoDB missing, got a failure. Ran normally, got success.

Reviewers: btrahan, vrana, jungejason

Reviewed By: btrahan

CC: aran

Maniphest Tasks: T993

Differential Revision: https://secure.phabricator.com/D2160
This commit is contained in:
epriestley 2012-04-08 15:03:38 -07:00
parent e4df959064
commit 056fd755da

View file

@ -498,9 +498,22 @@ final class PhabricatorSetup {
return;
}
$engines = queryfx_all($conn_raw, 'SHOW ENGINES');
$engines = ipull($engines, 'Engine', 'Engine');
if (empty($engines['InnoDB'])) {
self::writeFailure();
self::write(
"Setup failure! The 'InnoDB' engine is not available. Enable ".
"InnoDB in your MySQL configuration. If you already created tables, ".
"MySQL incorrectly used some other engine. You need to convert ".
"them or drop and reinitialize them.");
return;
} else {
self::write(" okay InnoDB is available.\n");
}
$databases = queryfx_all($conn_raw, 'SHOW DATABASES');
$databases = ipull($databases, 'Database');
$databases = array_fill_keys($databases, true);
$databases = ipull($databases, 'Database', 'Database');
if (empty($databases['phabricator_meta_data'])) {
self::writeFailure();
self::write(