Skip to content

Conversation

@RobXYZ
Copy link

@RobXYZ RobXYZ commented Dec 2, 2025

I found commands like sql:drop starting throwing errors after updating from 13.6.2 to 13.7 on my web host.

Error: Call to a member function command() on null in Drush\Commands\sql\SqlCommands->validate() (line 244 of /drush/drush/src/Commands/sql/SqlCommands.php).

This seems to be due to undefined PDO::MYSQL_ATTR_* constants. SqlBase::create() swallowed and returned null.

Codex found and wrote this fix so it may not be correct but hopefully points in the right direction.

SqlBase::create() swallowed and returned null, so the validator thought no driver existed
@weitzman
Copy link
Member

weitzman commented Dec 2, 2025

Whats your PHP version?

@RobXYZ
Copy link
Author

RobXYZ commented Dec 2, 2025

PHP 8.3.27

@weitzman
Copy link
Member

I'm not sure that its valid for those constants to be missing. Your mPDO would be busted. Anyway, here is how Drupal core handled this, in case anyone wants to make a different PR. I would merge that approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants