Jira issue originally created by user acleon:
EDITED: 2nd attempt to describe this - first one was confusing.
I don't understand why the setFetchMode() method of Doctrine\DBAL\Driver\PDOStatement drops any arguments passed to it. It means that PDO::FETCH_CLASS cannot be used with calls to fetch() and no warning is given until the point when the underlying \PDOStatement complains that no class has been specified.
Comment created by noodha:
In Doctrine/DBAL/Statement.php the 2nd and 3rd arguments of setFetchMode are dropped too.
Error message example when PDO::FETCH_CLASS is used as the first argument of setFetchMode:
$stmt->setFetchMode(PDO::FETCHCLASS | PDO::FETCH_PROPSLATE, 'ClassName');
display the error: PDOException: SQLSTATE[HY000]: General error: fetch mode requires the classname argument
Comment created by fabpot:
This regression was introduced here: f4acc79
It breaks some of my websites when upgrading DBAL. So, this is not an improvement but a regression bug.
Comment created by @beberlei:
Yes, i have to change this again.
The problem is its complex to support the 2nd/3rd arguments in the statement caching layer, i will just throw an exception for now and add an improvement ticket.
Issue was closed with resolution "Fixed"