Drush "watchdog-delete" command deletes all watchdog entries even if a filter argument is provided

Comments

kotnik’s picture

Priority: Normal » Minor

All filters are working except when you provide a string, ie:

$ drushgit watchdog-delete "Unable to find"
All messages matching "" will be deleted.
Do you really want to continue? (y/n): y
1001 watchdog messages have been deleted.

And it happily deleted all watchdog messages.

Does your patch fix this?

jonhattan’s picture

StatusFileSize
new830 bytes

@ahwebd only the first snippet of the patch is needed. Second one breaks the message. Consider those examples:

$ /usr/src/drush-978204/drush wd-del --severity=warning --type=php
All messages matching "type = php OR severity = 4" will be deleted.
Do you really want to continue? (y/n): n

$ /usr/src/drush-978204/drush wd-del "Cron run exceeded" --severity=warning --type=php
All messages matching "type = php OR severity = 4 OR message LIKE %Cron run exceeded%" will be deleted.
Do you really want to continue? (y/n): n
ahwebd’s picture

StatusFileSize
new1.03 KB

@kotnik

Does your patch fix this?

This is what it does

@jonhattan
Thanks!
however not all people are supposed to understand sql syntax, here's a corrected patch that makes the filter part of the drush message more user friendly

jonhattan’s picture

Status: Needs review » Fixed

Commited. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.