Skip to content

Commit

Permalink
Fixed fetching empty values from a SQL Server statement
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Mar 16, 2018
1 parent 1ebc1f0 commit b1953ea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
use Doctrine\DBAL\ParameterType;
use IteratorAggregate;
use Doctrine\DBAL\Driver\Statement;
use function func_get_args;

/**
* SQL Server Statement.
Expand Down Expand Up @@ -348,19 +349,19 @@ public function fetchAll($fetchMode = null, $fetchArgument = null, $ctorArgs = n

switch ($fetchMode) {
case FetchMode::CUSTOM_OBJECT:
while ($row = call_user_func_array([$this, 'fetch'], func_get_args())) {
while (($row = $this->fetch(...func_get_args())) !== false) {
$rows[] = $row;
}
break;

case FetchMode::COLUMN:
while ($row = $this->fetchColumn()) {
while (($row = $this->fetchColumn()) !== false) {
$rows[] = $row;
}
break;

default:
while ($row = $this->fetch($fetchMode)) {
while (($row = $this->fetch($fetchMode)) !== false) {
$rows[] = $row;
}
}
Expand Down

0 comments on commit b1953ea

Please sign in to comment.