From: yaogzhan at gmail dot com Operating system: winxp pro PHP version: 5.1.0b3 PHP Bug Type: PDO related Bug description: PDO statement causes Apache to halt when no row found
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 bug report at http://bugs.php.net/?id=34185&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34185&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34185&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34185&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34185&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34185&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34185&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34185&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34185&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34185&r=support Expected behavior: http://bugs.php.net/fix.php?id=34185&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34185&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34185&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34185&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34185&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34185&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34185&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34185&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34185&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34185&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34185&r=mysqlcfg