Skip to content

Loading…

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

Closed
doctrinebot opened this Issue · 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
@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.