drush icon indicating copy to clipboard operation
drush copied to clipboard

Flag --structure-tables-key=common ignored if using --extra=--no-tablespaces in Drush 8

Open back-2-95 opened this issue 4 years ago • 4 comments

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

back-2-95 avatar Sep 23 '21 07:09 back-2-95

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?

AlexSkrypnyk avatar Jun 21 '22 08:06 AlexSkrypnyk

PRs to provide more tests, and any needed fixes to argument passing would be appreciated.

greg-1-anderson avatar Jun 21 '22 14:06 greg-1-anderson