From f3ecabf4feb3d6bfe20e283829cff2623e30bd82 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Wed, 2 Aug 2023 15:55:20 -0700 Subject: [PATCH] Fix mysql test --- tasks.go | 4 ++++ tasks_test.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tasks.go b/tasks.go index e951fc9..302d14e 100644 --- a/tasks.go +++ b/tasks.go @@ -160,6 +160,10 @@ func (t JobTaskMySQL) GetPostTask() ExecutableTask { command = append(command, "--host", t.Hostname) } + if t.Port != 0 { + command = append(command, "--port", fmt.Sprintf("%d", t.Port)) + } + if t.Username != "" { command = append(command, "--user", t.Username) } diff --git a/tasks_test.go b/tasks_test.go index 0706c39..185dfba 100644 --- a/tasks_test.go +++ b/tasks_test.go @@ -163,7 +163,7 @@ func TestJobTaskSql(t *testing.T) { " --user user --password=pass --no-tablespaces db table1 table2", postBackup: "", preRestore: "", - postRestore: "mysql --host host --user user --password=pass db < ./simple.sql", + postRestore: "mysql --host host --port 3306 --user user --password=pass db < ./simple.sql", }, // Sqlite {