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

watchdog:tail throws sql exception when using options or argument #5121

Closed
mradcliffe opened this issue Apr 11, 2022 · 0 comments
Closed

watchdog:tail throws sql exception when using options or argument #5121

mradcliffe opened this issue Apr 11, 2022 · 0 comments

Comments

@mradcliffe
Copy link

Describe the bug

Running watchdog:tail with options or arguments throws an exception.

To Reproduce

Any of the following:

./vendor/bin/drush watchdog:tail --severity=3
./vendor/bin/drush watchdog:tail --type=php
./vendor/bin/drush watchdog:tail "anything"

Expected behavior

The command should succeed without an exception.

Actual behavior

An exception is thrown instead of output. Using MariaDB the exception message is:

SQLSTATE[HY093]: Invalid parameter number: mixed name and positional parameters: SELECT "w".*
FROM
"watchdog" "w"
WHERE (message LIKE :filter AND wid > ?)
ORDER BY "wid" DESC
LIMIT 10, OFFSET 0; Array
(
     [:filter] => "%anything%"
     [:wid] => 0
)

Workaround

No

System Configuration

Q A
Drush version? 10.6.2 or greater (code has not changed since #4767)
Drupal version? 9.3.x
PHP version 7.4.x with PDO driver mysql using MariaDB.
OS? Linux

Additional information

https://github.com/drush-ops/drush/blame/11.x/src/Drupal/Commands/core/WatchdogCommands.php#L147

This should be changed from a positional parameter to a named parameter.

weitzman added a commit to weitzman/drush that referenced this issue Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant