Skip to content
This repository has been archived by the owner on Jan 13, 2022. It is now read-only.

Commit

Permalink
Add --force-innodb option
Browse files Browse the repository at this point in the history
Implied by fbcode. Likely to break things on MySQL < 5.6 - eg mediawiki uses it
for a full text search table, which isn't supported by InnoDB until 5.6

fixes #39
  • Loading branch information
fredemmott committed May 11, 2015
1 parent 5117826 commit 23d4ac0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
6 changes: 6 additions & 0 deletions base/DatabaseInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,18 @@ public function installDatabase(): bool {
}
$this->checkMySQLConnectionLimit();

$sed = null;
if ($this->options->forceInnodb) {
$sed = 'sed s/MyISAM/InnoDB/g |';
}

shell_exec(
Utils::EscapeCommand(Vector {
$this->options->dumpIsCompressed ? 'zcat' : 'cat',
$dump,
}).
'|'.
$sed .
Utils::EscapeCommand(Vector {
'mysql',
'-h', '127.0.0.1',
Expand Down
4 changes: 4 additions & 0 deletions base/PerfOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ final class PerfOptions {
public string $siege;
public string $nginx;

public bool $forceInnodb = false;
public bool $skipSanityCheck = false;
public bool $skipWarmUp = false;
public bool $skipVersionChecks = false;
Expand Down Expand Up @@ -126,6 +127,7 @@ public function __construct(Vector<string> $argv) {
'all-volatile',
'interp-pseudomains',

'force-innodb',
'fbcode::',

'tcprint::',
Expand Down Expand Up @@ -208,6 +210,7 @@ public function __construct(Vector<string> $argv) {
} else {
$fbcode = getenv('HOME') . '/fbcode';
}
$this->forceInnodb = true;
}

$this->notBenchmarking = array_key_exists('i-am-not-benchmarking', $o);
Expand Down Expand Up @@ -249,6 +252,7 @@ public function __construct(Vector<string> $argv) {
$this->tcTopfuncs = array_key_exists('dump-top-funcs', $o);
$this->pcredump = array_key_exists('dump-pcre-cache', $o);
$this->profBC = array_key_exists('profBC', $o);
$this->forceInnodb = $isFacebook || array_key_exists('force-innodb', $o);

if ($this->tcprint !== null &&
!$this->tcTopfuncs && !$this->tcToptrans) {
Expand Down

0 comments on commit 23d4ac0

Please sign in to comment.