Skip to content

Commit

Permalink
Fix nasty bug with pdo not auto binding integer values
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikbjorn committed Jul 12, 2013
1 parent e96d3f5 commit 0381fac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Changelog
=========

0.7.1 / 2013-07-12
------------------

* Fix bug in `DoctrineDriver` with prepared statements and limit placeholders.

0.7.0 / 2013-07-12
------------------

Expand Down
6 changes: 5 additions & 1 deletion src/Bernard/Driver/DoctrineDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,14 @@ public function acknowledgeMessage($queueName, $receipt)
public function peekQueue($queueName, $index = 0, $limit = 20)
{
$query = 'SELECT message FROM bernard_messages WHERE queue = ? LIMIT ?, ?';
$statement = $this->connection->executeQuery($query, array(
$params = array(
$queueName,
$index,
$index + $limit,
);

$statement = $this->connection->executeQuery($query, $params, array(
'string', 'integer', 'integer'
));

return $statement->fetchAll(\PDO::FETCH_COLUMN);
Expand Down

0 comments on commit 0381fac

Please sign in to comment.