#35428 [Fbk->Opn]: using mysqli with MySQL 5.0.16 causes Apache crash
| From: | marcing at smlw dot pl | Date: | Sun, 27 Nov 2005 22:25:33 +0000 |
| Subject: | #35428 [Fbk->Opn]: using mysqli with MySQL 5.0.16 causes Apache crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-89129@lists.php.net to get a copy of this message | ||
ID: 35428
User updated by: marcing at smlw dot pl
Reported By: marcing at smlw dot pl
-Status: Feedback
+Status: Open
Bug Type: MySQLi related
Operating System: WinXP SP2
PHP Version: 5.1.0
New Comment:
Unfortunately i cannot reproduce it on unix at the moment (have to
upgrade the mysql), but
ill gladly provide further information on windows.
hint: it is essential to create a table with content, im not sure if i
provided enough of it;)
Previous Comments:
------------------------------------------------------------------------
[2005-11-27 21:35:49] tony2001@php.net
Please, instead of adding "me too!" comments try to make a research and
find the cause.
------------------------------------------------------------------------
[2005-11-27 21:24:43] dooshek at desmart dot com
I have the same problem with the same script. My env:
Windows XP SP2
Apache 2.0.55
MySQL 5.0.15
PHP 5.0.5
My Apache hangs during script execution.
------------------------------------------------------------------------
[2005-11-27 21:20:36] tony2001@php.net
I can't reproduce it.
Can you try it on an *nix OS ?
------------------------------------------------------------------------
[2005-11-27 21:12:56] marcing at smlw dot pl
Description:
------------
Env:
Windows XP SP2
Apache 2.0.48 / 2.0.55 (not relevant)
MySQL 5.0.16
PHP 5.0.3 /5.1 (not relevant)
MySQLi
Important: Problem is related to MySQLi when using MySQL version 5
only, it doesn't occur with version 4.
Reproduce code:
---------------
<?php
$db = new mysqli(...);
if($stmt = $db->prepare('SELECT SUM(visitors) FROM core_stats')) {
$stmt->execute();
$stmt->bind_result($total);
$stmt->close();
}
?>
The problem occurs when using SUM() in query, endless loop seems to
start when $stmt->bind_result($total) is invoked and as a result Apache
crashes.
Database reproduction code:
----------------------------------
CREATE TABLE
core_stats (
id int(10) unsigned NOT NULL auto_increment,
day_of_week int(1) unsigned NOT NULL default '0',
day_of_month int(2) unsigned NOT NULL default '0',
m int(2) unsigned NOT NULL default '0',
y int(4) unsigned NOT NULL default '0',
visitors int(10) unsigned NOT NULL default '0',
PRIMARY KEY (id)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
INSERT INTO core_stats VALUES (1, 2, 5, 7, 2005, 1);
INSERT INTO core_stats VALUES (2, 3, 6, 7, 2005, 6);
INSERT INTO core_stats VALUES (3, 4, 7, 7, 2005, 7);
INSERT INTO core_stats VALUES (4, 5, 8, 7, 2005, 1);
Expected result:
----------------
It should work as it worked on MySQL 4.
Actual result:
--------------
Internal Server Error
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=35428&edit=1