Skip to content

Commit

Permalink
CLI-1257: pull:db fails with too many tables
Browse files Browse the repository at this point in the history
  • Loading branch information
danepowell committed Feb 2, 2024
1 parent 4bf61f3 commit d594768
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Command/Pull/PullCommandBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,8 @@ private function dropDbTables(string $dbHost, string $dbUser, string $dbName, st
$tables = $this->listTablesQuoted($process->getOutput());
if ($tables) {
$sql = 'DROP TABLE ' . implode(', ', $tables);
$tempnam = $this->localMachineHelper->getFilesystem()->tempnam(sys_get_temp_dir(), 'acli_drop_table', 'sql');
$this->localMachineHelper->getFilesystem()->dumpFile($tempnam, $sql);
$command = [
'mysql',
'--host',
Expand All @@ -390,7 +392,7 @@ private function dropDbTables(string $dbHost, string $dbUser, string $dbName, st
$dbUser,
$dbName,
'-e',
$sql,
'source ' . $tempnam,
];
$process = $this->localMachineHelper->execute($command, $outputCallback, NULL, FALSE, NULL, ['MYSQL_PWD' => $dbPassword]);
if (!$process->isSuccessful()) {
Expand Down

0 comments on commit d594768

Please sign in to comment.