ID:               35368
 Updated by:       [EMAIL PROTECTED]
 Reported By:      lists at cyberlot dot net
-Status:           Feedback
+Status:           Assigned
 Bug Type:         PDO related
 Operating System: Centos 4.1
 PHP Version:      6CVS-2005-11-24 (snap)
 Assigned To:      wez
 New Comment:

We managed to reproduce the problem; it's a problem with the query
rewriter when it maps :name to ?.  If the string is embedded in the SQL
using single quotes, but has double quotes backslashed, the string it
too tricky for the parser to follow, and it ends up transforming parts
of the serialized string that it shouldn't.

There are three possible workarounds for this issue, in order of
preference:
- Don't embed serialized data into the query string; use bound
parameters (that's what they're there for).  In future versions of PDO,
prepared statements may be cacheable in persistent connections, leading
to a performance gain.
- Use PDO::quote() to correctly quote the string
- Use PDO::exec() to fire off this UPDATE/INSERT statement; it uses an
alternate API that doesn't need to handle parameters.



Previous Comments:
------------------------------------------------------------------------

[2005-11-25 16:40:35] [EMAIL PROTECTED]

This is fixed in CVS, get a fresh snapshot and try again.

------------------------------------------------------------------------

[2005-11-25 16:32:07] lists at cyberlot dot net

To try and narrow this down and be able to play with the code more I
recompiled PHP 5.1 without pdo support then compiled seperate modules
however I could not get pdo_mysql to compile.
I phpized ./configure and make and get the following error

checking for MySQL support for PDO... yes, shared
checking for mysql_config... /usr/bin/mysql_config
checking for mysql_query... no
configure: error: mysql_query missing!?

Might be related? So I forced a install of pdo_mysql RC2

The bug goes away, Same exact script but everything is working...

So its either a diffrence between pdo_mysql RC2 or some wierd issue
with shared vs compiled in.

I hope that helps somehow?

------------------------------------------------------------------------

[2005-11-25 15:16:27] lists at cyberlot dot net

Also for note, In both cases pdo suport was configured in, not
installed by pear.

------------------------------------------------------------------------

[2005-11-25 15:14:33] lists at cyberlot dot net

What OS are you testing on? All I have are Centos/Redhat based boxes to
test on.

Also if this helps I always download directly from MySQL I never use
the DIST included rpms.

------------------------------------------------------------------------

[2005-11-25 15:11:22] lists at cyberlot dot net

Run this on another box, MySQL 4.1.12 and php 5.1.0RC4 same results

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
    http://bugs.php.net/35368

-- 
Edit this bug report at http://bugs.php.net/?id=35368&edit=1

Reply via email to