DDC-2937 More informative response when using single scalar hydrator when it returns single row but multiple columns.
This commit is contained in:
parent
6e9b15a48f
commit
1488a509b2
@ -43,10 +43,14 @@ class SingleScalarHydrator extends AbstractHydrator
|
||||
throw new NoResultException();
|
||||
}
|
||||
|
||||
if ($numRows > 1 || count($data[key($data)]) > 1) {
|
||||
if ($numRows > 1) {
|
||||
throw new NonUniqueResultException('The query returned multiple rows. Change the query or use a different result function like getScalarResult().');
|
||||
}
|
||||
|
||||
if (count($data[key($data)]) > 1) {
|
||||
throw new NonUniqueResultException('The row contains multiple columns. Change the query or use a different result function like getScalarResult().');
|
||||
}
|
||||
|
||||
$cache = array();
|
||||
$result = $this->gatherScalarRowData($data[key($data)], $cache);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user