We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb85f4c commit cdb7e79Copy full SHA for cdb7e79
src/ClickHouseStatement.php
@@ -141,6 +141,11 @@ protected function assumeFetchMode($fetchMode = null)
141
public function fetch($fetchMode = null)
142
{
143
$data = $this->getIterator()->current();
144
+
145
+ if (null === $data) {
146
+ return false;
147
+ }
148
149
$this->getIterator()->next();
150
151
if (\PDO::FETCH_NUM === $this->assumeFetchMode($fetchMode)) {
@@ -215,8 +220,7 @@ function ($row) {
215
220
*/
216
221
public function fetchColumn($columnIndex = 0)
217
222
218
- if ($elem = $this->fetch()) {
219
- $elem = array_values($elem);
223
+ if ($elem = $this->fetch(\PDO::FETCH_NUM)) {
224
225
return isset($elem[$columnIndex]) ? $elem[$columnIndex] : $elem[0];
226
}
0 commit comments