Doctrine DBAL
  1. Doctrine DBAL
  2. DBAL-257

OCI8Statement::fetchColumn() returns null instead of false

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.2
    • Fix Version/s: None
    • Component/s: Drivers
    • Security Level: All
    • Labels:
      None

      Description

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

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

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

        Activity

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            lorenzo zoffoli
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: