You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
According to the discussion in php/php-src#3655, the fact that PDOStatement::fetchColumn() returns null for an invalid column index, is a bug. Starting 7.2.14 and other newer PHP versions, DataAccessTest::testFetchColumnNonExistingIndex() will fail:
↪ php --version
PHP 7.2.14-dev (cli) (built: Nov 26 2018 15:14:02) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
↪ phpunit --filter testFetchColumnNonExistingIndex tests/Doctrine/Tests/DBAL/Functional/DataAccessTest.php
PHPUnit 7.4.0 by Sebastian Bergmann and contributors.
Testing Doctrine\Tests\DBAL\Functional\DataAccessTest
E 1 / 1 (100%)
Time: 39 ms, Memory: 6.00MB
There was 1 error:
1) Doctrine\Tests\DBAL\Functional\DataAccessTest::testFetchColumnNonExistingIndex
Exception: [Doctrine\DBAL\Driver\PDOException] SQLSTATE[HY000]: General error: Invalid column index
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
This test was introduced as part of #709 but it doesn't cover the issue which was fixed.
Instead of supporting this behavior by means of a workaround, I think we should just remove the test and document the changes. Invalid column index usually is a sign of a logical error in the client code and shouldn't be silently suppressed by the DBAL.
The text was updated successfully, but these errors were encountered:
According to the discussion in php/php-src#3655, the fact that
PDOStatement::fetchColumn()
returnsnull
for an invalid column index, is a bug. Starting 7.2.14 and other newer PHP versions,DataAccessTest::testFetchColumnNonExistingIndex()
will fail:This test was introduced as part of #709 but it doesn't cover the issue which was fixed.
Instead of supporting this behavior by means of a workaround, I think we should just remove the test and document the changes. Invalid column index usually is a sign of a logical error in the client code and shouldn't be silently suppressed by the DBAL.
The text was updated successfully, but these errors were encountered: