Skip to content

Commit d3f658f

Browse files
committed
fix fetching NULL values via fetchColumn()
1 parent 4af1b64 commit d3f658f

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

lib/Doctrine/DBAL/Driver/IBMDB2/DB2Statement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public function fetchColumn($columnIndex = 0)
267267
return false;
268268
}
269269

270-
return isset($row[$columnIndex]) || array_key_exists($columnIndex, $row) ? $row[$columnIndex] : null;
270+
return isset($row[$columnIndex]) ? $row[$columnIndex] : null;
271271
}
272272

273273
/**

lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ public function fetchColumn($columnIndex = 0)
293293
return false;
294294
}
295295

296-
return isset($row[$columnIndex]) || array_key_exists($columnIndex, $row) ? $row[$columnIndex] : null;
296+
return isset($row[$columnIndex]) ? $row[$columnIndex] : null;
297297
}
298298

299299
/**

lib/Doctrine/DBAL/Driver/SQLAnywhere/SQLAnywhereStatement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function fetchColumn($columnIndex = 0)
270270
return false;
271271
}
272272

273-
return isset($row[$columnIndex]) || array_key_exists($columnIndex, $row) ? $row[$columnIndex] : null;
273+
return isset($row[$columnIndex]) ? $row[$columnIndex] : null;
274274
}
275275

276276
/**

lib/Doctrine/DBAL/Driver/SQLSrv/SQLSrvStatement.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ public function fetch($fetchMode = null)
251251
}
252252

253253
$rows = sqlsrv_fetch_object($this->stmt, $className, $ctorArgs);
254+
254255
return $rows ?: false;
255256
}
256257

@@ -295,7 +296,7 @@ public function fetchColumn($columnIndex = 0)
295296
return false;
296297
}
297298

298-
return isset($row[$columnIndex]) || array_key_exists($columnIndex, $row) ? $row[$columnIndex] : null;
299+
return isset($row[$columnIndex]) ? $row[$columnIndex] : null;
299300
}
300301

301302
/**

0 commit comments

Comments
 (0)