diff --git a/lib/Interpreter/DataIterator.php b/lib/Interpreter/DataIterator.php index dfd7382..618f975 100644 --- a/lib/Interpreter/DataIterator.php +++ b/lib/Interpreter/DataIterator.php @@ -57,7 +57,7 @@ class DataIterator implements \Iterator, \Countable { if ($this->rowCount > $this->tupleCount) { $this->packageSize = floor($this->rowCount / $this->tupleCount); - $this->tupleCount = floor($this->rowCount / $this->packageSize) + $this->rowCount % $this->packageSize; + $this->tupleCount = floor($this->rowCount / $this->packageSize) + 1; } else { $this->packageSize = 1; @@ -80,7 +80,6 @@ class DataIterator implements \Iterator, \Countable { } $this->key++; - Util\Debug::log('key++', $this->key); return $this->current = $package; } diff --git a/lib/Interpreter/Interpreter.php b/lib/Interpreter/Interpreter.php index 67b0534..f7b2bc9 100644 --- a/lib/Interpreter/Interpreter.php +++ b/lib/Interpreter/Interpreter.php @@ -110,9 +110,6 @@ abstract class Interpreter { // query for data $stmt = $this->conn->executeQuery('SELECT ' . $sql['fields'] . $sql['from'] . $sql['where'] . $sql['groupBy'] . $sql['orderBy'], array($this->channel->getId())); - Util\Debug::log('rowcount', $this->rowCount); - Util\Debug::log('tuplecount', $this->tupleCount); - return new DataIterator($stmt, $this->rowCount, $this->tupleCount); }