-
Notifications
You must be signed in to change notification settings - Fork 373
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
Is_callable throws an exception if PDOStatement method does not exist. #1258
Comments
Thank you @Beakerboy for bringing this to our attention. While I understand it may not be an expected behavior to throw an exception, it's been like this since version 3.0 for pdo_sqlsrv. We will get back to you on this. |
The following was recently added to Drupal core: public function __call($method, $arguments) {
if (is_callable([$this->getClientStatement(), $method])) {
@trigger_error("StatementWrapper::{$method} should not be called in drupal:9.1.0 and will error in drupal:10.0.0. Access the client-level statement object via ::getClientStatement(). See https://www.drupal.org/node/3177488", E_USER_DEPRECATED);
return call_user_func_array([$this->getClientStatement(), $method], $arguments);
}
throw new \BadMethodCallException($method);
} It successfully runs on Postgres, MySQL, and SQLite...potentially others as well. The GOOD thing is that in this particular case, an exception would be thrown regardless, but of a different type. |
Thanks @Beakerboy so it's a matter of throwing different exceptions? |
From a semantics perspective, it would make sense for a function named |
Hi @Beakerboy |
Closing this issue as per 5.10.0-beta1 |
PHP Driver version or file name
pecl install sqlsrv pdo_sqlsrv
on 2021-05-12SQL Server version
Client operating system
PHP version
Microsoft ODBC Driver version
Table schema
Problem description
is_callable()
on the sqlsrv version of a PDOStatement throws an exception if the method does not exist.PDOException: SQLSTATE[IMSSP]: This function is not implemented by this driver.
Expected behavior and actual behavior
Repro code or steps to reproduce
The text was updated successfully, but these errors were encountered: