Skip to content

Commit

Permalink
[8.x] Fix for #34592 artisan schema:dump error (#36698)
Browse files Browse the repository at this point in the history
* It mysqldump errors because "set-gtid-purged" isn't a valid option retry without it.

* Update MySqlSchemaState.php

Co-authored-by: Matt Davis <Hamroll3>
Co-authored-by: Taylor Otwell <[email protected]>
  • Loading branch information
matt-hullo and taylorotwell authored Mar 22, 2021
1 parent f201b81 commit baa48bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Illuminate/Database/Schema/MySqlSchemaState.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ protected function executeDumpProcess(Process $process, $output, array $variable
), $output, $variables);
}

if (Str::contains($e->getMessage(), ['set-gtid-purged'])) {
return $this->executeDumpProcess(Process::fromShellCommandLine(
str_replace(' --set-gtid-purged=OFF', '', $process->getCommandLine())
), $output, $variables);
}

throw $e;
}

Expand Down

0 comments on commit baa48bf

Please sign in to comment.