Bug #57432 [Fbk->NoF]: PDO_ODBC: Wrong indexes for returned row

From: Date: Sun, 20 Sep 2015 04:22:18 +0000
Subject: Bug #57432 [Fbk->NoF]: PDO_ODBC: Wrong indexes for returned row
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196104@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=57432&edit=1 ID: 57432 Updated by: php-bugs@lists.php.net Reported by: rysenko at gmail dot com Summary: PDO_ODBC: Wrong indexes for returned row -Status: Feedback +Status: No Feedback Type: Bug Package: PDO ODBC Operating System: Windows XP PHP Version: 5.2.0 RC4 Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2015-09-08 22:14:29] cmb@php.net Is that still an issue with recent PHP versions? ------------------------------------------------------------------------ [2006-12-15 07:37:59] rysenko at gmail dot com Description: ------------ I'm doing a simple count query against catalogued DB2 database through PDO. By default PDO::FETCH_BOTH mode is used and I expect to see result in 0 index of the fetched row, but it appears in indexes 1 and 2. Same occurs with queries like "SELECT 1+1 FROM arcticles". This only occurs on DB2 through PDO, and doesn't occur on MySQL through PDO, DB2 through ibm_db2 or DB2 through ODBC. So I consider this to be a bug in PDO. Reproduce code: --------------- $conn = new PDO('odbc:CATNAME', 'user', 'pass'); $sql = 'SELECT COUNT(*) FROM articles'; foreach ($conn->query($sql) as $row) { var_dump($row); } Expected result: ---------------- array(2) { [0]=> string(1) "7"} or maybe array(2) { ["COUNT(*)"]=> string(1) "7" [0]=> string(1) "7"} like in MySQL through PDO Actual result: -------------- array(2) { [1]=> string(1) "7" [2]=> string(1) "7" } ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=57432&edit=1

« previous php.bugs (#196104) next »