Fixed fetching empty values from a SQL Server statement

parent 1ebc1f02
...@@ -24,6 +24,7 @@ use Doctrine\DBAL\FetchMode; ...@@ -24,6 +24,7 @@ use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\ParameterType; use Doctrine\DBAL\ParameterType;
use IteratorAggregate; use IteratorAggregate;
use Doctrine\DBAL\Driver\Statement; use Doctrine\DBAL\Driver\Statement;
use function func_get_args;
/** /**
* SQL Server Statement. * SQL Server Statement.
...@@ -348,19 +349,19 @@ class SQLSrvStatement implements IteratorAggregate, Statement ...@@ -348,19 +349,19 @@ class SQLSrvStatement implements IteratorAggregate, Statement
switch ($fetchMode) { switch ($fetchMode) {
case FetchMode::CUSTOM_OBJECT: 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; $rows[] = $row;
} }
break; break;
case FetchMode::COLUMN: case FetchMode::COLUMN:
while ($row = $this->fetchColumn()) { while (($row = $this->fetchColumn()) !== false) {
$rows[] = $row; $rows[] = $row;
} }
break; break;
default: default:
while ($row = $this->fetch($fetchMode)) { while (($row = $this->fetch($fetchMode)) !== false) {
$rows[] = $row; $rows[] = $row;
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment