DBAL-257: OCI8Statement::fetchColumn() returns null instead of false #1434

Closed
doctrinebot opened this Issue Apr 16, 2012 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user zoff:

In
public function fetchColumn($columnIndex = 0)
{
$row = ocifetch_array($this->_sth, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURNLOBS);
return $row[$columnIndex];
}

there is no control on ocifetch_array() returned value.
When it returns false fetchColumn() returns null instead of false.

Solution:
public function fetchColumn($columnIndex = 0)
{
$row = ocifetch_array($this->_sth, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURNLOBS);
return isset($row[$columnIndex]) ? $row[$columnIndex] : false;
}

@doctrinebot

Comment created by @beberlei:

Fixed

@doctrinebot

Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label Dec 6, 2015
@beberlei beberlei was assigned by doctrinebot Dec 6, 2015
@doctrinebot doctrinebot closed this Dec 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment