#33717 [Asn->Fbk]: crash 'apache' when a query contain ':memory:'
| From: | wez@php.net | Date: | Sat, 16 Jul 2005 14:09:26 +0000 |
| Subject: | #33717 [Asn->Fbk]: crash 'apache' when a query contain ':memory:' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-81935@lists.php.net to get a copy of this message | ||
ID: 33717
Updated by: wez@php.net
Reported By: fhenninot at freesurf dot fr
-Status: Assigned
+Status: Feedback
Bug Type: PDO related
Operating System: Linux
PHP Version: 5.1.0b3
Assigned To: wez
New Comment:
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.
Please provide a backtrace for both of those crashes
Previous Comments:
------------------------------------------------------------------------
[2005-07-16 10:53:34] fhenninot at freesurf dot fr
hi wez!
thank you for your help! but!!
If i use parameters, this don't crash apache!! ok!
but if my table haven't record like the parameter (now not only
'::memory') then that kill the PHP script!!
I've test it on beta2 and this work properly but with beta3 crashed.
------------------------------------------------------------------------
[2005-07-15 23:33:22] wez@php.net
Doh. Like this:
$stmt = $db->prepare("SELECT * from database where location like ?");
$stmt->execute(array(":memory:"));
------------------------------------------------------------------------
[2005-07-15 23:32:41] wez@php.net
BTW, if you want a workaround, you can use parameters like this:
$stmt = $db->prepare("SELECT * from database where location like ?");
$stmt->execute(array(":memory"));
------------------------------------------------------------------------
[2005-07-15 23:30:54] wez@php.net
Sounds like a pretty nasty problem to me.
------------------------------------------------------------------------
[2005-07-15 23:01:05] fhenninot at freesurf dot fr
Description:
------------
This is a bug, i think, in PHP-5.1B3
When i search a string named ':memory:' into a database field, this
crash apache with the message : [Fri Jul 15 20:17:11 2005] [notice]
child pid 11338 exit signal Segmentation fault (11)
I can test it on linux only! and with some apache version.
Reproduce code:
---------------
<?php
$PDO_DB = new
PDO('sqlite:/usr/local/apache2/htdocs/SQLiteManager-1.1.2CVS/include/config3.db',
'', '');
$res = $PDO_DB->query("SELECT * FROM database WHERE location like
':memory:'");
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33717&edit=1