Commit f3844dc2 authored by Benjamin Eberlei's avatar Benjamin Eberlei

Revert "Fixing issue when number of positional parameters != number of given types"

This reverts commit 0b6a6aef.
parent 10be52ae
...@@ -103,7 +103,7 @@ class SQLParserUtils ...@@ -103,7 +103,7 @@ class SQLParserUtils
$arrayPositions[$name] = false; $arrayPositions[$name] = false;
} }
if (( ! $arrayPositions && $isPositional)) { if (( ! $arrayPositions && $isPositional) || (count($params) != count($types))) {
return array($query, $params, $types); return array($query, $params, $types);
} }
...@@ -159,7 +159,7 @@ class SQLParserUtils ...@@ -159,7 +159,7 @@ class SQLParserUtils
$pos += $queryOffset; $pos += $queryOffset;
$queryOffset -= ($paramLen - 1); $queryOffset -= ($paramLen - 1);
$paramsOrd[] = $value; $paramsOrd[] = $value;
$typesOrd[] = isset($types[$paramName]) ? $types[$paramName] : \PDO::PARAM_STR; $typesOrd[] = $types[$paramName];
$query = substr($query, 0, $pos) . '?' . substr($query, ($pos + $paramLen)); $query = substr($query, 0, $pos) . '?' . substr($query, ($pos + $paramLen));
continue; continue;
......
...@@ -237,22 +237,6 @@ SQLDATA ...@@ -237,22 +237,6 @@ SQLDATA
array(), array(),
array() array()
), ),
array(
"SELECT * FROM Foo WHERE foo IN (:foo) OR bar = :bar OR baz = :baz",
array('foo' => array(1, 2), 'bar' => 'bar', 'baz' => 'baz'),
array('foo' => Connection::PARAM_INT_ARRAY, 'baz' => 'string'),
'SELECT * FROM Foo WHERE foo IN (?, ?) OR bar = ? OR baz = ?',
array(1, 2, 'bar', 'baz'),
array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_STR, 'string')
),
array(
"SELECT * FROM Foo WHERE foo IN (:foo) OR bar = :bar",
array('foo' => array(1, 2), 'bar' => 'bar'),
array('foo' => Connection::PARAM_INT_ARRAY),
'SELECT * FROM Foo WHERE foo IN (?, ?) OR bar = ?',
array(1, 2, 'bar'),
array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_STR)
),
); );
} }
......
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