Skip to content

Commit

Permalink
Fix yajra#413, binding issue.
Browse files Browse the repository at this point in the history
Set default length to -1.
  • Loading branch information
yajra committed Apr 17, 2018
1 parent 505d1cb commit c303316
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/Oci8/Oci8Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,17 +428,14 @@ protected function getDefaultPostProcessor()
public function addBindingsToStatement(PDOStatement $stmt, array $bindings)
{
foreach ($bindings as $key => &$binding) {

//defaults
$value = &$binding;
$type = PDO::PARAM_STR;
$length = null;
$length = -1;

// extended array syntax for bindings
if (is_array($binding)) {
$value = &$binding['value'];
$type = array_key_exists('type', $binding) ? $binding['type'] : PDO::PARAM_STR;
$length = array_key_exists('length', $binding) ? $binding['length'] : null;
$length = array_key_exists('length', $binding) ? $binding['length'] : -1;
}

$stmt->bindParam(':' . $key, $value, $type, $length);
Expand Down

0 comments on commit c303316

Please sign in to comment.