mysqldump option #41

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

Comments

Projects
None yet
2 participants
@todiadiyatmo

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

This comment has been minimized.

Show comment
Hide comment
@sebastianfeldmann

sebastianfeldmann Dec 18, 2015

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@sebastianfeldmann

sebastianfeldmann Dec 18, 2015

Owner

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

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

This comment has been minimized.

Show comment
Hide comment
@todiadiyatmo

todiadiyatmo 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

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

This comment has been minimized.

Show comment
Hide comment
@sebastianfeldmann

sebastianfeldmann Dec 21, 2015

Owner

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.

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