Fixed fetching empty values from a SQL Server statement

parent 1ebc1f02
......@@ -24,6 +24,7 @@ use Doctrine\DBAL\FetchMode;
use Doctrine\DBAL\ParameterType;
use IteratorAggregate;
use Doctrine\DBAL\Driver\Statement;
use function func_get_args;
/**
* SQL Server Statement.
......@@ -348,19 +349,19 @@ class SQLSrvStatement implements IteratorAggregate, Statement
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;
}
}
......
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