Commit 6a62fefe authored by Benjamin Eberlei's avatar Benjamin Eberlei

Merge branch 'DBAL-522' into 2.3

parents 081e461e 0ba5e102
...@@ -212,12 +212,12 @@ class SQLParserUtils ...@@ -212,12 +212,12 @@ class SQLParserUtils
*/ */
static private function extractParam($paramName, $paramsOrTypes, $isParam, $defaultValue = null) static private function extractParam($paramName, $paramsOrTypes, $isParam, $defaultValue = null)
{ {
if (isset($paramsOrTypes[$paramName])) { if (array_key_exists($paramName, $paramsOrTypes)) {
return $paramsOrTypes[$paramName]; return $paramsOrTypes[$paramName];
} }
// Hash keys can be prefixed with a colon for compatibility // Hash keys can be prefixed with a colon for compatibility
if (isset($paramsOrTypes[':' . $paramName])) { if (array_key_exists(':' . $paramName, $paramsOrTypes)) {
return $paramsOrTypes[':' . $paramName]; return $paramsOrTypes[':' . $paramName];
} }
......
...@@ -287,6 +287,23 @@ SQLDATA ...@@ -287,6 +287,23 @@ SQLDATA
array(1, 2, 'bar'), array(1, 2, 'bar'),
array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_STR) array(\PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_STR)
), ),
// DBAL-522 - null valued parameters are not considered
array(
'INSERT INTO Foo (foo, bar) values (:foo, :bar)',
array('foo' => 1, 'bar' => null),
array(':foo' => \PDO::PARAM_INT, ':bar' => \PDO::PARAM_NULL),
'INSERT INTO Foo (foo, bar) values (?, ?)',
array(1, null),
array(\PDO::PARAM_INT, \PDO::PARAM_NULL)
),
array(
'INSERT INTO Foo (foo, bar) values (?, ?)',
array(1, null),
array(\PDO::PARAM_INT, \PDO::PARAM_NULL),
'INSERT INTO Foo (foo, bar) values (?, ?)',
array(1, null),
array(\PDO::PARAM_INT, \PDO::PARAM_NULL)
),
); );
} }
......
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