From:
Operating system: OS X 10.6.3
PHP version: 5.3.2
Package: PDO related
Bug Type: Bug
Bug description:getColumnMeta causes segfault when re-executing query after
calling nextRowset
Description:
------------
After executing a prepared statement and calling PDOStatement::nextRowset
(whether
or not there is more than one result set), then calling
PDOStatement::execute a
second time, PDOStatement::getColumnMeta causes a segfault. I guess it
really is
an experimental feature.
Platform info:
OS X 10.6.3
Apache 2.2.14
PHP 5.3.2 (also tested under 5.3.1 with same result)
MySQL 5.1.45
Test script:
---------------
$db = new PDO('mysql:...', ...);
$query = $db->prepare('SELECT 1 AS num;');
$query->execute();
$query->nextRowset();
$query->execute();
$query->getColumnMeta(0);
Expected result:
----------------
PDOStatement::getColumnMeta should return an array describing a column. For
the
test script, something like:
<code>
array (
'native_type' => 'LONGLONG',
'pdo_type' => 2,
'flags' =>
array (
0 => 'not_null',
),
'table' => '',
'name' => 'num',
'len' => 1,
'precision' => 0,
)
</code>
Actual result:
--------------
Segfault. For example, on my machine I get:
Process: httpd [31734]
Path: /usr/sbin/httpd
Identifier: httpd
Version: ??? (???)
Code Type: X86-64 (Native)
Parent Process: httpd [31718]
Date/Time: 2010-04-26 19:02:55.650 -0700
OS Version: Mac OS X 10.6.3 (10D573)
Report Version: 6
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Thread 0 Crashed: Dispatch queue: com.apple.main-thread
0 libphp5.so 0x0000000101163923
zim_PDOStatement_getColumnMeta + 262
1 libphp5.so 0x0000000101334704
zend_do_fcall_common_helper_SPEC + 2409
2 libphp5.so 0x0000000101330fd9 execute + 585
3 libphp5.so 0x000000010130fe18 zend_execute_scripts
+ 376
4 libphp5.so 0x00000001012c2b3a php_execute_script +
705
5 libphp5.so 0x000000010138baf3 php_handler + 1237
6 httpd 0x00000001000012af ap_run_handler + 90
7 httpd 0x0000000100001b8e ap_invoke_handler +
346
8 httpd 0x000000010002e784 ap_process_request +
103
9 httpd 0x000000010002aff7
ap_process_http_connection + 116
10 httpd 0x000000010001280b
ap_run_process_connection + 90
11 httpd 0x0000000100012ca5 ap_process_connection
+ 91
12 httpd 0x00000001000353f2 child_main + 1257
13 httpd 0x00000001000355a8 make_child + 329
14 httpd 0x000000010003582e
perform_idle_server_maintenance + 498
15 httpd 0x0000000100035d58 ap_mpm_run + 1246
16 httpd 0x00000001000098f5 main + 2854
17 httpd 0x0000000100000914 start + 52
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x0000000000000001 rbx: 0x0000000000000000 rcx: 0x00007fff5fbfef48
rdx: 0x0000000000000028
rdi: 0x00000001007412be rsi: 0x00000001013dbdde rbp: 0x00007fff5fbfeff0
rsp: 0x00007fff5fbfefc0
r8: 0x0000000000000001 r9: 0x0000000000000006 r10: 0x00000001013cf158
r11: 0x00000001007412b8
r12: 0x000000010073d000 r13: 0x000000010073c4a0 r14: 0x0000000000000001
r15: 0x0000000000000000
rip: 0x0000000101163923 rfl: 0x0000000000000246 cr2: 0x0000000000000000
--
Edit bug report at http://bugs.php.net/bug.php?id=51670&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51670&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51670&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=51670&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=51670&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51670&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51670&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51670&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51670&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51670&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51670&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51670&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51670&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51670&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51670&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51670&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51670&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51670&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51670&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51670&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51670&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51670&r=mysqlcfg