-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Statement::fetchColumn() will throw an exception in the case of invalid index #3417
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comments suggesting array_key_exists()
usage are just suggestions: I think they are semantically more correct than using count()
.
4fc885f
to
1aef645
Compare
04c8e7a
to
4be2553
Compare
public function testFetchColumnNonExistingIndex(int $index) : void | ||
{ | ||
if ($this->connection->getWrappedConnection() instanceof PDOConnection) { | ||
$this->markTestSkipped('PDO supports this behavior natively but throws a different exception'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't bother handling the PDO exception since the only way to identify it is by the message. It's a logical exception, so it's not supposed to be handled at runtime anyways.
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
Statement::fetchColumn() will throw an exception in the case of invalid index
This is a BC-breaking implementation of the changes originally implemented in #3359.