Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author Soenke Ruempler - NorthClick <soenke.ruempler@northclick.de>
Full name Soenke Ruempler - NorthClick <soenke.ruempler@northclick.de>
Date 2006-11-17 08:00:11 PST
Message Hans Lellelid <mailto:hans at velum dot net> wrote on Friday, November 17, 2006
3:19 PM:

> Thanks, Soenke, you beat me too it :)
>
> Yeah, maybe we could do that by default for MySQL, though it does
> seem like a bit of a hack. We should probably issue a debug logging
> statement indicating that we're doing that, if we do turn
> that on behind
> the scenes. If you want to look into it, I'd be grateful, as I'm
> probably not going to get to it today otherwise.

I guess for beta-testing this "hack"/workaround without logging should be
enough, shouldn't it?

Index: PropelPDO.php
====================​====================​====================​=======
--- PropelPDO.php (revision 497)
+++ PropelPDO.php (working copy)
@@ -41,6 +41,22 @@
 class PropelPDO extends PDO {

        /**
+ * The constructor - currently just for a MySQL driver workaround
+ *
+ */
+ public function __construct($dsn, $username = null, $password =
null, array $driver_options = array()) {
+
+ parent::__construct($dsn, $username, $password,
$driver_options);
+
+ // Toggle PS Emulation for MySQL driver as the native
server-side
+ // implementation seems to be buggy and slow
+ if ($this->getAttri​bute(PDO::ATTR_DRIVE​R_NAME) == 'mysql') {
+ $this->setAttrib​ute(PDO::ATTR_EMULAT​E_PREPARES,
true);
+ }
+
+ }
+
+ /**
         * The current transaction depth.
         * @var int
         */

If no one complains, I'll create a ticket and commit the patch.

-soenke