From:             mcnuke at gmx dot net
Operating system: Debian Sarge Linux Kernel 2.6
PHP version:      5.0.1
PHP Bug Type:     Reproducible crash
Bug description:  mysqli_num_rows() crashes

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 bug report at http://bugs.php.net/?id=29771&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=29771&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=29771&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=29771&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=29771&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=29771&r=needtrace
Need Reproduce Script:      http://bugs.php.net/fix.php?id=29771&r=needscript
Try newer version:          http://bugs.php.net/fix.php?id=29771&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=29771&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=29771&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=29771&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=29771&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=29771&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29771&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=29771&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=29771&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=29771&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=29771&r=float

Reply via email to