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

mysqldump option #41

Closed
todiadiyatmo opened this issue Dec 18, 2015 · 4 comments
Closed

mysqldump option #41

todiadiyatmo opened this issue Dec 18, 2015 · 4 comments
Assignees
Labels

Comments

@todiadiyatmo
Copy link

@todiadiyatmo todiadiyatmo commented Dec 18, 2015

Hi,
Is it possible to add mysqldump specific option , for example --lock-tables=false ? Do you interesting to add such feature ? If i want to fork it, what file i should look at ?

Kind Regards

@sebastianfeldmann
Copy link
Owner

@sebastianfeldmann sebastianfeldmann commented Dec 18, 2015

Hi,
good suggestion, I will add it tonight.
If you want to do it in a fork you have to look at 2 files.

  1. The Mysqldump Source class src/Backup/Source/Maysldump.php
    Here you have to enable the new option
  2. The Mysqldump executable class
    src/Cli/Executable/Mysqldump.php
    This class actually creates the command that gets executed.

But I will add it anyway so... :)

Cheers Sebastian

@sebastianfeldmann
Copy link
Owner

@sebastianfeldmann sebastianfeldmann commented Dec 18, 2015

Hi,
I checked the mysqldump docs.
It looks like --lock-tables doesn't take a value, so to make it not lock tables you just don't add the option.
If you run mysqldump without --lock-tables it shouldn't lock any tables.

I added the option lockTables to version 2.1.15 so you can lock tables during dumping.
You can have a look at the documentation

Cheers, Sebastian

@todiadiyatmo
Copy link
Author

@todiadiyatmo todiadiyatmo commented Dec 21, 2015

Hi @sebastianfeldmann
Thank you for the quick patch + class code guideline :)

Actually what i mean is the ability to put extra mysql command ( not specific to lock-table).

Please check, i add "extraCommand" here :
todiadiyatmo@f119f3a

Also from mysqldump docs, there is a tons of options available , i think it is time consuming if we port each mysqldump command to the phpbu mysqldump.

Cheers

@sebastianfeldmann
Copy link
Owner

@sebastianfeldmann sebastianfeldmann commented Dec 21, 2015

Hi,
yes you are right it is time consuming :) to add all the options available to the mysqldump command.
But there are options that are not available in the mysqldump command that make it hard to add "custom/extra" options if that's what you want to achieve.
There are cases where phphbu will create two separate mysqldump commands and the specified custom options maybe don't make sense on both of them. So you could run into some messy problems with this.
Then there is the security issue you would add with this if the custom/extra options aren't escaped properly.

Can you please give me an example of what you want to achieve with extraCommand?

I still think it is best to separately add the options you need.
Indeed more work but more "secure" and better testable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.