Commit e05f26d8 authored by Marco Pivetta's avatar Marco Pivetta

Merge branch 'hotfix/#2434-#2261-#2262-#2386-keep-bound-oci8-parameters-from-gc-2.5' into 2.5

Close #2434
Close #2261
Close #2262
Close #2386
parents 9e1300bf f285ea55
......@@ -71,6 +71,15 @@ class OCI8Statement implements \IteratorAggregate, Statement
*/
protected $_paramMap = array();
/**
* Holds references to bound parameter values.
*
* This is a new requirement for PHP7's oci8 extension that prevents bound values from being garbage collected.
*
* @var array
*/
private $boundValues = array();
/**
* Creates a new OCI8Statement that uses the given connection handle and SQL statement.
*
......@@ -148,11 +157,17 @@ class OCI8Statement implements \IteratorAggregate, Statement
$lob = oci_new_descriptor($this->_dbh, OCI_D_LOB);
$lob->writeTemporary($variable, OCI_TEMP_BLOB);
$this->boundValues[$column] =& $lob;
return oci_bind_by_name($this->_sth, $column, $lob, -1, OCI_B_BLOB);
} elseif ($length !== null) {
$this->boundValues[$column] =& $variable;
return oci_bind_by_name($this->_sth, $column, $variable, $length);
}
$this->boundValues[$column] =& $variable;
return oci_bind_by_name($this->_sth, $column, $variable);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment