Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #2261 - OCI8 Driver PHP 7 - Fix bindValue overwriting other params. #2262

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ class OCI8Statement implements \IteratorAggregate, Statement
*/
protected $_paramMap = array();

/**
* @var array
*/
protected $_bindings = array();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not introduce a protected member here, unless completely necessary. Otherwise we will have to keep BC for that afterwards. Also please do not use the old underscore prefix naming here. private $bindings is fine.


/**
* Creates a new OCI8Statement that uses the given connection handle and SQL statement.
*
Expand Down Expand Up @@ -134,7 +139,8 @@ static public function convertPositionalToNamedPlaceholders($statement)
*/
public function bindValue($param, $value, $type = null)
{
return $this->bindParam($param, $value, $type, null);
$this->_bindings[$param] = $value;
return $this->bindParam($param, $this->_bindings[$param], $type, null);
}

/**
Expand Down