php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58020 Problem fetch null datetime field
Submitted: 2008-01-25 13:43 UTC Modified: 2015-01-25 04:22 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: eromero at sitrack dot com Assigned:
Status: No Feedback Package: *General Issues
PHP Version: 5_2 CVS-2008-01-25 OS: *
Private report: No CVE-ID: None
 [2008-01-25 13:43 UTC] eromero at sitrack dot com
Description:
------------
Hi!, I?m have installed PDO_ODBC with unixodbc. I?m using it with Informix IDS 10 and php 5.2.5.

It works perfectly until I try to fetch a row with a datetime field = null.
It generates a SEGFAULT in apache. If the datetime field has any value, it works perfectly. But with a null value it crash.

I also try with iODBC and the result was the same.


Thanks and Regards

Emiliano S. Romero



Reproduce code:
---------------
$r = $pdo->query("select id,date from table");

while($a = $r->fetch()) {
  var_dump($a);
  // it'll echo until a null value in date
}

Expected result:
----------------
Fetched Data

Actual result:
--------------
Core was generated by `/usr/sbin/apache2-php5 -D PHP5 -D DEFAULT_VHOST -D INFO -d /usr/lib64/apache2-p'.
Program terminated with signal 11, Segmentation fault.

#0  0x00002b6375fe029c in memcpy () from /lib/libc.so.6
(gdb) bt
#0  0x00002b6375fe029c in memcpy () from /lib/libc.so.6
#1  0x00000000ffffffff in ?? ()
#2  0x0000000000e0a908 in ?? ()
#3  0x0000000000c94d78 in ?? ()
#4  0x0000000000000090 in ?? ()
#5  0x0000000000e0aa98 in ?? ()
#6  0x00002b6378d9de40 in _estrndup () from /usr/lib64/apache2-php5/modules/libphp5.so
#7  0x00002b637b38a7e6 in fetch_value (stmt=0xe00031, dest=0xe086e0, colno=<value optimized out>,
    type_override=<value optimized out>) at
/tmp/pear/download/PDO-1.0.3/pdo_stmt.c:559
#8  0x00002b637b38b05e in do_fetch (stmt=0xc94d78, do_bind=<value optimized
out>, return_value=0xdfe9f8, how=14680984,
    ori=<value optimized out>, offset=<value optimized out>, return_all=0x0) at /tmp/pear/download/PDO-1.0.3/pdo_stmt.c:967
#9  0x00002b637b38c44b in zim_PDOStatement_fetch (ht=<value optimized out>, return_value=0xdfe9f8,
    return_value_ptr=<value optimized out>, this_ptr=<value optimized out>, return_value_used=<value optimized out>)
    at /tmp/pear/download/PDO-1.0.3/pdo_stmt.c:1227
#10 0x00002b6378dd35b2 in ?? () from
/usr/lib64/apache2-php5/modules/libphp5.so
#11 0x00002b6378dd26e2 in execute () from /usr/lib64/apache2-php5/modules/libphp5.so
#12 0x00002b6378dd2e73 in ?? () from
/usr/lib64/apache2-php5/modules/libphp5.so
#13 0x00002b6378dd26e2 in execute () from /usr/lib64/apache2-php5/modules/libphp5.so
#14 0x00002b6378dd2e73 in ?? () from
/usr/lib64/apache2-php5/modules/libphp5.so
#15 0x00002b6378dd26e2 in execute () from /usr/lib64/apache2-php5/modules/libphp5.so
#16 0x00002b6378db5956 in zend_execute_scripts () from /usr/lib64/apache2-php5/modules/libphp5.so
#17 0x00002b6378d77a6a in php_execute_script () from /usr/lib64/apache2-php5/modules/libphp5.so
#18 0x00002b6378e2b293 in ?? () from
/usr/lib64/apache2-php5/modules/libphp5.so
#19 0x0000000000431293 in ap_run_handler ()
#20 0x0000000000434136 in ap_invoke_handler ()
#21 0x000000000043d8ee in ap_process_request ()
#22 0x000000000043b056 in ?? ()
#23 0x0000000000437a24 in ap_run_process_connection ()
#24 0x0000000000441099 in ?? ()
#25 0x00000000004412e8 in ?? ()
#26 0x0000000000441ae2 in ap_mpm_run ()
#27 0x0000000000420a39 in main ()

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-15 19:44 UTC] danack@php.net
-Status: Open +Status: Feedback -Package: PDO_ODBC +Package: *General Issues
 [2015-01-15 19:44 UTC] danack@php.net
If this is still a problem for you, please can you add some details of what the problem is and how to reproduce it.
 [2015-01-25 04:22 UTC] php-bugs at lists dot php dot net
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.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Dec 06 23:01:26 2024 UTC