ID: 29771
User updated by: mcnuke at gmx dot net
Reported By: mcnuke at gmx dot net
Status: Open
Bug Type: Reproducible crash
Operating System: Debian Sarge Linux Kernel 2.6
PHP Version: 5.0.1
New Comment:
i forgot to say .. i'm using mysql 4.1.3
Previous Comments:
------------------------------------------------------------------------
[2004-08-20 12:15:59] mcnuke at gmx dot net
Description:
------------
PHP crashes when calling the num_rows property of a result object:
apache 2.0.50 error log:
[Fri Aug 20 11:57:40 2004] [notice] child pid 17780 exit signal
Segmentation fault (11)
Reproduce code:
---------------
<?php
$conn = new mysqli('localhost', 'root', '');
$conn->select_db('test');
$conn->query("DROP TABLE segfault;");
$conn->query("CREATE TABLE segfault (id TINYINT NOT NULL, PRIMARY KEY
(id));");
$res = $conn->query("SELECT * FROM segfault;");
echo $res->num_rows; // this line causes php to crash
$conn->close();
?>
Expected result:
----------------
printing a value: 0
Actual result:
--------------
PHP crashes
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29771&edit=1