Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix UNIX socket support for MySQL in dump action #267

Merged
merged 4 commits into from
Feb 21, 2023

Conversation

Enrico204
Copy link
Contributor

@Enrico204 Enrico204 commented Jan 27, 2022

mysqldumpArgs was missing the --socket parameter when launching mysqldump for UNIX socket connections. This pull request adds the parameter if the socket query option is added in the database URL

Closes #235

@amacneil
Copy link
Owner

amacneil commented Jan 27, 2022

Thanks! Can you add "Closes #235" in the PR description so that it is linked to the bug and will automatically close it when merged?

@@ -145,6 +145,9 @@ func (drv *Driver) mysqldumpArgs() []string {
if password, set := drv.databaseURL.User.Password(); set {
args = append(args, "--password="+password)
}
if socket := drv.databaseURL.Query().Get("socket"); drv.databaseURL.Hostname() == "" && socket != "" {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I forget, do we have any tests for this function? Would be nice to add a test to cover the new functionality.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently, no. But I might try to come up with some testing. Let me see what I can do :-)

@amacneil
Copy link
Owner

Thanks! I added some tests.

@amacneil amacneil enabled auto-merge (squash) February 21, 2023 06:56
@amacneil amacneil merged commit 9f1f346 into amacneil:main Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dump fail without setting hostname and passoword in MySQl
2 participants