ID: 37294 Comment by: thad at bronto dot com Reported By: tgross at m-s dot de Status: Assigned Bug Type: PDO related Operating System: Windows 2000 PHP Version: 5.1.3 Assigned To: wez New Comment:
I see this exact behavior using apache 2.0.55 on Centos 4.2 with php 5.1.3. Previous Comments: ------------------------------------------------------------------------ [2006-05-03 14:58:41] tgross at m-s dot de Description: ------------ When calling PDO::query(), PHP crashes Apache on certain queries if the SQL-query contains errors. In the example, Query 1 is correct. Query 2 is wrong, and the exception is thrown (which is expected). Query 3 causes Apache to crash. Reproduce code: --------------- $dbh = new PDO ('odbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c:/path/to/database/db.mdb', '', ''); $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); try { //$result = $dbh->query('select * from aktuelles'); // Query 1: Correct //$result = $dbh->query('select * from aktuellesX'); // Query 2: Wrong (Table aktuellesX does not exist) $result = $dbh->query('selectX * from aktuelles'); // Query 3: Wrong (Command selectX does not exist) $ret = $result->fetchAll(PDO::FETCH_ASSOC); } catch (Exception $e) { echo "Failed: " , $e->getMessage(); } Expected result: ---------------- PHP throws an exception and displays the error message. Actual result: -------------- Apache crashes. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37294&edit=1