php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29771 mysqli_num_rows() crashes
Submitted: 2004-08-20 12:15 UTC Modified: 2004-08-20 12:52 UTC
Votes:5
Avg. Score:5.0 ± 0.0
Reproduced:5 of 5 (100.0%)
Same Version:4 (80.0%)
Same OS:3 (60.0%)
From: mcnuke at gmx dot net Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.0.1 OS: Debian Sarge Linux Kernel 2.6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: mcnuke at gmx dot net
New email:
PHP Version: OS:

 

 [2004-08-20 12:15 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-08-20 12:37 UTC] mcnuke at gmx dot net
i forgot to say .. i'm using mysql 4.1.3
 [2004-08-20 12:45 UTC] derick@php.net
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
 [2004-08-20 12:52 UTC] georg@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

see #29656 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun May 05 10:01:31 2024 UTC