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

Statement::fetchColumn() will throw an exception in the case of invalid index #3417

Merged
merged 1 commit into from
Feb 9, 2019

Conversation

morozov
Copy link
Member

@morozov morozov commented Dec 22, 2018

Q A
Type improvement
BC Break yes
Fixed issues #3358

This is a BC-breaking implementation of the changes originally implemented in #3359.

Copy link
Member

@Ocramius Ocramius left a 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().

lib/Doctrine/DBAL/Cache/ArrayStatement.php Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/Cache/ResultCacheStatement.php Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/DBALException.php Show resolved Hide resolved
lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php Outdated Show resolved Hide resolved
lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php Outdated Show resolved Hide resolved
@morozov morozov force-pushed the issues/3358 branch 2 times, most recently from 4fc885f to 1aef645 Compare December 27, 2018 20:53
@morozov morozov force-pushed the issues/3358 branch 2 times, most recently from 04c8e7a to 4be2553 Compare January 20, 2019 20:06
public function testFetchColumnNonExistingIndex(int $index) : void
{
if ($this->connection->getWrappedConnection() instanceof PDOConnection) {
$this->markTestSkipped('PDO supports this behavior natively but throws a different exception');
Copy link
Member Author

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.

@morozov morozov merged commit ffeeb00 into doctrine:develop Feb 9, 2019
@morozov morozov deleted the issues/3358 branch February 9, 2019 21:36
morozov added a commit that referenced this pull request Feb 20, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Feb 22, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
@morozov morozov self-assigned this Feb 27, 2019
morozov added a commit that referenced this pull request Mar 15, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Mar 15, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Mar 18, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Apr 16, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request May 6, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request May 23, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit to morozov/dbal that referenced this pull request May 31, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Jun 13, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Jun 27, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit to morozov/dbal that referenced this pull request Aug 26, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
morozov added a commit that referenced this pull request Nov 2, 2019
Statement::fetchColumn() will throw an exception in the case of invalid index
@morozov morozov removed this from the 4.0.0 milestone Nov 17, 2020
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants