#34185 [Opn->Fbk]: PDO statement causes Apache to halt when no row found

From: Date: Thu, 18 Aug 2005 11:16:36 +0000
Subject: #34185 [Opn->Fbk]: PDO statement causes Apache to halt when no row found
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-83761@lists.php.net to get a copy of this message
ID: 34185 Updated by: sniper@php.net Reported By: yaogzhan at gmail dot com -Status: Open +Status: Feedback Bug Type: PDO related Operating System: winxp pro PHP Version: 5.1.0b3 New Comment: Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip Works fine (when you really fetch something from the executed statement..) Previous Comments: ------------------------------------------------------------------------ [2005-08-18 12:53:34] yaogzhan at gmail dot com Description: ------------ Sqlite3 database named id.sl3 contains an empty table created by this SQL query: create table id(id INTERGE PRIMARY KEY, txt); Use PDO prepared statment to query the table. Since the table is empty, no rows will return. execute() method of the PDO statment object will cause: 1. Apache to halt if using mod_php 2. CGI/FastCGI to halt, while Apache still working providing static contents, if using CGI/FastCGI Reproduce code: --------------- <?PHP # make a PDO $pdo = new PDO('sqlite:id.sl3'); # select a row that doesn't exist in the table $stmt = $pdo->prepare('SELECT * FROM id WHERE id = 1000'); # if no row found, PDO will cause Apache to halt $stmt->execute(); ?> Expected result: ---------------- execute() should return empty array. not clear if with output binding. Actual result: -------------- nothing in Apache log file recorded for this. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34185&edit=1

« previous php.bugs (#83761) next »