diff --git a/lib/Doctrine/Connection.php b/lib/Doctrine/Connection.php index 276f89e73..1f122c643 100644 --- a/lib/Doctrine/Connection.php +++ b/lib/Doctrine/Connection.php @@ -758,7 +758,7 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun try { if ( ! empty($params)) { - $stmt = $this->dbh->prepare($query); + $stmt = $this->prepare($query); $stmt->execute($params); return $stmt; } else { diff --git a/lib/Doctrine/Connection/Statement.php b/lib/Doctrine/Connection/Statement.php index 3a5f4618d..1246cecb7 100644 --- a/lib/Doctrine/Connection/Statement.php +++ b/lib/Doctrine/Connection/Statement.php @@ -213,8 +213,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf */ public function execute($params = null) { - $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->_stmt->queryString, $params); - // print $this->_stmt->queryString . print_r($params, true) . "
"; + $event = new Doctrine_Event($this, Doctrine_Event::STMT_EXECUTE, $this->getQuery(), $params); $this->_conn->getListener()->preExecute($event); if ( ! $event->skipOperation) { @@ -257,7 +256,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf $cursorOrientation = Doctrine::FETCH_ORI_NEXT, $cursorOffset = null) { - $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCH, $this->_stmt->getQuery()); + $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCH, $this->getQuery()); $event->fetchMode = $fetchMode; $event->cursorOrientation = $cursorOrientation; @@ -289,7 +288,7 @@ class Doctrine_Connection_Statement implements Doctrine_Adapter_Statement_Interf public function fetchAll($fetchMode = Doctrine::FETCH_BOTH, $columnIndex = null) { - $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCHALL, $this->_stmt->getQuery()); + $event = new Doctrine_Event($this, Doctrine_Event::STMT_FETCHALL, $this->getQuery()); $event->fetchMode = $fetchMode; $event->columnIndex = $columnIndex;