Somewhere around 5.0.x mysql changed the behavior of affected_rows() - It used to not return information only for UPDATE, DELETE - and in a latter version was updated to also return the # of rows selected by a SELECT. Am I right or wrong and in what version?
Or what mysql driver is needed? (Ex. does it only happen with mysqldnd or with sockets?). I know not not to rely on the function for this purposes, but that is then and this is now. I need to reproduce it in a testing environment and need to know the exact conditions under which the behavior of affected_rows() changes with PHP PDO.
=== solved ===
self::$dbAdapter = new Zend_Db_Adapter_Pdo_Mysql( array('dbname'=>'vaf', 'username'=>'root', 'password'=>'') );
self::$dbAdapter->getConnection()->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY,false);
Make sure buffered query is false, read the setting back because apparently this setting likes to not take affect. Once buffered querying is false, I was able to replicate the issue in a unit test.