php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34185 PDO statement causes Apache to halt when no row found
Submitted: 2005-08-18 12:53 UTC Modified: 2005-08-26 01:00 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: yaogzhan at gmail dot com Assigned:
Status: No Feedback Package: PDO related
PHP Version: 5.1.0b3 OS: winxp pro
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: yaogzhan at gmail dot com
New email:
PHP Version: OS:

 

 [2005-08-18 12:53 UTC] 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. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-18 13:16 UTC] sniper@php.net
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..)

 [2005-08-26 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri May 09 21:01:27 2025 UTC