drush
drush copied to clipboard
Flag --structure-tables-key=common ignored if using --extra=--no-tablespaces in Drush 8
Describe the bug
This will include table data listed in $options['structure-tables']['common']:
drush sql-dump --structure-tables-key=common --extra=--no-tablespaces > dump.sql`
This will include table data listed in $options['structure-tables']['common']:
drush sql-dump --structure-tables-key=common > dump.sql`
To Reproduce
In drushrc.php I have
$options['structure-tables']['common'] = array('cache', 'cache_*', 'history', 'search_*', 'sessions', 'watchdog', 'feeds_log');
Expected behavior Dump should have those tables as structure only (no data).
Actual behavior Data was in the dump.
Workaround
Removing --extra=--no-tablespaces from command.
System Configuration
| Q | A |
|---|---|
| Drush version? | 8.4.8 |
| Drupal version? | 7.x |
| PHP version | 7.4.x |
| OS? | Mac/Linux |
Still exists in Drush 10.
Just to put the scale of this problem in perspective: when we added --extra, our non-prod envs started to send emails, because queue table, which, along with other tables that should had only structure, had unprocessed items.
This is scary. Such a small thing.
Not sure how tests did not pick it up. Are there any tests for CLI args?
PRs to provide more tests, and any needed fixes to argument passing would be appreciated.