#38168 [Opn->Fbk]: PDO Exception Causes PHP Crash
| From: | tony2001@php.net | Date: | Sun, 23 Jul 2006 07:11:20 +0000 |
| Subject: | #38168 [Opn->Fbk]: PDO Exception Causes PHP Crash | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99774@lists.php.net to get a copy of this message | ||
ID: 38168
Updated by: tony2001@php.net
Reported By: php at unfit dot org
-Status: Open
+Status: Feedback
Bug Type: PDO related
Operating System: Gentoo Linux
PHP Version: 5.1.4
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php5.2-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5.2-win32-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2006-07-20 21:35:46] php at unfit dot org
Description:
------------
Core dump on PDO error.
PDO error code if checked before execute is 'HY093'.
Reproduce code:
---------------
<?php
//use actual database, user and password where applicable
$dbh = new PDO('pgsql:host=127.0.0.1;dbname=foo', 'foo', 'foo');
$query = $dbh->prepare('INSERT INTO table (varA, varB, varC) VALUES (
:varA, :varB, :varC );');
$query->bindValue(':foo', 'foo');
$query->bindValue(':varC', 'foo');
$err = $query->errorCode();
echo "$err\n";
echo "you will see this.\n"; flush();
$query->execute();
/*
CRASH POINT
You will see only output that has been flushed.
If running on the command line you will also see something like
this:
*** glibc detected *** malloc(): memory corruption: 0x16987018 ***
Aborted (core dumped)
*/
echo "you won't see this.\n"; flush();
?>
Expected result:
----------------
HY093
you will see this.
you won't see this.
Actual result:
--------------
HY093
you will see this.
*** glibc detected *** malloc(): memory corruption: 0x16987018 ***
Aborted (core dumped)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=38168&edit=1