#35428 [Fbk]: using mysqli with MySQL 5.0.16 causes Apache crash

From: Date: Sun, 27 Nov 2005 20:35:50 +0000
Subject: #35428 [Fbk]: using mysqli with MySQL 5.0.16 causes Apache crash
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89121@lists.php.net to get a copy of this message
ID: 35428 Updated by: tony2001@php.net Reported By: marcing at smlw dot pl Status: Feedback Bug Type: MySQLi related Operating System: WinXP SP2 PHP Version: 5.1.0 New Comment: Please, instead of adding "me too!" comments try to make a research and find the cause. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#89121) next »