#48821 [Opn->Fbk]: mysql_fetch_assoc segfaults on second parameter

From: Date: Mon, 06 Jul 2009 17:19:00 +0000
Subject: #48821 [Opn->Fbk]: mysql_fetch_assoc segfaults on second parameter
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-139343@lists.php.net to get a copy of this message
 ID:               48821
 Updated by:       jani@php.net
 Reported By:      margus at zone dot ee
-Status:           Open
+Status:           Feedback
 Bug Type:         MySQL related
 Operating System: CentOS 4.7/x86_64
 PHP Version:      5.3.0
 New Comment:

What was the full configure line used to compile PHP?


Previous Comments:
------------------------------------------------------------------------

[2009-07-06 16:59:02] margus at zone dot ee

Description:
------------
mysql_fetch_assoc/mysql_fetch_array will segfault PHP if second
parameter (MYSQL_BOTH, MYSQL_ASSOC or MYSQL_NUM) is specified.

The value of parameter does'nt make any difference.

This happens only for PHP-CGI and Apache module and strangely not to
CLI.

Reproduce code:
---------------
<?php

mysql_connect ("localhost", "user", "password");
mysql_select_db ("test");

$r = mysql_query ("SELECT * FROM users");

print_r (mysql_fetch_assoc ($r, MYSQL_BOTH));

?>

Expected result:
----------------
Array
(
    [id] => 1
    [username] => asd1
    [email] => asd2
    [asd] => 2000
)

Actual result:
--------------
Segmentation fault


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=48821&edit=1



Thread (8 messages)

« previous php.bugs (#139343) next »