DBAL-228: OCI8Statement' fetchAll method can not do with PDO::FETCH_BOTH #1403

Closed
doctrinebot opened this Issue Mar 2, 2012 · 2 comments

2 participants

@doctrinebot

Jira issue originally created by user zhouhero:

/****
 * {@inheritdoc}
 */

private static $fetchStyleMap = array(
    PDO::FETCH*BOTH => OCI*BOTH,
    PDO::FETCH*ASSOC => OCI*ASSOC,
    PDO::FETCH*NUM => OCI*NUM
);

public function fetchAll($fetchStyle = PDO::FETCH_BOTH)
{
if ( ! isset(self::$fetchStyleMap[$fetchStyle])) {
throw new \InvalidArgumentException("Invalid fetch style: " . $fetchStyle);
}

    $result = array();
    oci*fetch_all($this->*sth, $result, 0, -1,
        self::$fetchStyleMap[$fetchStyle] | OCI*RETURN_NULLS | OCI_FETCHSTATEMENT_BY_ROW | OCI_RETURN*LOBS);

    return $result;
}

ocifetchall method can only surport

  • OCI_NUM
  • OCI_ASSOC

in $fetchStyleMap, OCI_BOTH is included!!!!

@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 added this to the 2.2.2 milestone 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