From 9625d13f7b76ed22c8d4c24d411531abe8502854 Mon Sep 17 00:00:00 2001 From: thomazzo <30912311+thomazzo@users.noreply.github.com> Date: Mon, 29 Oct 2018 18:45:30 +0000 Subject: [PATCH] Fixed #29882 -- Added events and stored routines to MySQL's cloned test databases. --- django/db/backends/mysql/creation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/django/db/backends/mysql/creation.py b/django/db/backends/mysql/creation.py index 43456adfdd..8ccd211b0e 100644 --- a/django/db/backends/mysql/creation.py +++ b/django/db/backends/mysql/creation.py @@ -55,9 +55,9 @@ class DatabaseCreation(BaseDatabaseCreation): self._clone_db(source_database_name, target_database_name) def _clone_db(self, source_database_name, target_database_name): - dump_cmd = DatabaseClient.settings_to_cmd_args(self.connection.settings_dict) - dump_cmd[0] = 'mysqldump' - dump_cmd[-1] = source_database_name + dump_args = DatabaseClient.settings_to_cmd_args(self.connection.settings_dict)[1:] + dump_args[-1] = source_database_name + dump_cmd = ['mysqldump', '--routines', '--events'] + dump_args load_cmd = DatabaseClient.settings_to_cmd_args(self.connection.settings_dict) load_cmd[-1] = target_database_name