php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38054 PDO with db2 returning column names but not data
Submitted: 2006-07-10 06:31 UTC Modified: 2006-10-19 01:00 UTC
From: john dot enevoldson at pulsen dot se Assigned: wez (profile)
Status: No Feedback Package: PDO related
PHP Version: 5.1.4 OS: SLES 9.3 64 bit
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: john dot enevoldson at pulsen dot se
New email:
PHP Version: OS:

 

 [2006-07-10 06:31 UTC] john dot enevoldson at pulsen dot se
Description:
------------
We are seeing column names returned but no associated data when issuing selects against a db2 data source using pdo:odbc (bulit with the ibm-db2 option). DB2 trace shows that data is being returned to the application correctly but the application does not seem to pick it up. 

Reproduce code:
---------------
$dbh = new PDO('odbc:zdb2lt01' , 'db2tst01', 'adg680');
   foreach ($dbh->query('SELECT * from PXX.XPRMFOK') as $row) {
     print_r($row);
   }

Expected result:
----------------
A array for each row in the table showing column name and associated data.

Actual result:
--------------
A array for each row in the table showing column name but associated data is empty.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-10 09:41 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

What does var_dump($row); show, btw?
 [2006-07-10 11:24 UTC] john dot enevoldson at pulsen dot se
Hi,
Have installed php5.2-latest.tar.gz but now get a segmentation fault during the connect processing,
Regards,
John.
 [2006-07-10 11:45 UTC] tony2001@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.


 [2006-07-10 12:12 UTC] john dot enevoldson at pulsen dot se
Hi,
backtrace genereated for the segmentation fault using the 5.2 cvs:

(gdb) bt
#0  _zval_ptr_dtor (zval_ptr=0x3ffffffc280) at /home/tje/php/php5.2-200607100830/Zend/zend_execute_API.c:393
#1  0x000000008021a356 in zend_do_fcall_common_helper_SPEC (execute_data=0x3ffffffc750) at zend_execute.h:148
#2  0x000000008021a7e6 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=<value optimized out>) at zend_vm_execute.h:322
#3  0x000000008027e936 in execute (op_array=0x805139e8) at zend_vm_execute.h:92
#4  0x00000000801f5514 in zend_execute_scripts (type=8, retval=0x0, file_count=3)
    at /home/tje/php/php5.2-200607100830/Zend/zend.c:1110
#5  0x00000000801b1f18 in php_execute_script (primary_file=0x3ffffffece8)
    at /home/tje/php/php5.2-200607100830/main/main.c:1748
#6  0x0000000080280140 in main (argc=2, argv=0x3fffffff388) at /home/tje/php/php5.2-200607100830/sapi/cli/php_cli.c:1097
(gdb)

Best regards,

John.
 [2006-07-10 12:17 UTC] john dot enevoldson at pulsen dot se
missed this bit :
(gdb) frame 3
#3  0x000000008027e936 in execute (op_array=0x805139e8) at zend_vm_execute.h:92
92                      if (EX(opline)->handler(&execute_data TSRMLS_CC) > 0) {

/John
 [2006-07-11 04:44 UTC] john dot enevoldson at pulsen dot se
Hi,
Have done some more digging around and find bug 32800 and 32830 relating to odbc (not pdo) which is very similar to our original problem - may give some clues...
Regards,
John.
 [2006-10-11 03:19 UTC] wez@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip

I think I just fixed this in CVS.  It would be great if you could grab the next snapshot dated after this message and validate that it works.

 [2006-10-19 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Oct 31 23:01:28 2024 UTC