Skip to content

Commit

Permalink
Making tests pass with MySQL
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jun 9, 2013
1 parent 2d1beb5 commit e5fa433
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions lib/Cake/Database/Statement/BufferedStatement.php
Expand Up @@ -26,10 +26,19 @@ class BufferedStatement extends StatementDecorator {

protected $_counter = 0;

/**
* Constructor
*
* @param Statement implementation such as PDOStatement
* @return void
*/
public function __construct($statement = null, $driver = null) {
parent::__construct($statement, $driver);
$this->_reset();
}

public function execute($params = null) {
$this->_count = $this->_counter = 0;
$this->_records = [];
$this->_allFetched = false;
$this->_reset();
return parent::execute($params);
}

Expand Down Expand Up @@ -77,5 +86,12 @@ public function rowCount() {
public function rewind() {
$this->_counter = 0;
}

public function _reset() {
$this->_count = $this->_counter = 0;
$this->_records = [];
$this->_allFetched = false;
}

}

0 comments on commit e5fa433

Please sign in to comment.