Guard against missing PDO MySQL constants
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.
Whats your PHP version?
PHP 8.3.27
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.