[DBAL-522] BC break : executeQuery with an array containing null value(s). Created: 20/May/13 Updated: 21/May/13 Resolved: 21/May/13 |
|
| Status: | Resolved |
| Project: | Doctrine DBAL |
| Component/s: | None |
| Affects Version/s: | 2.3.4 |
| Fix Version/s: | 2.4, 2.3.5 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | lemeunier | Assignee: | Marco Pivetta |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | dbal | ||
| Environment: |
Mac OSX 10.8.3, Mysql 5.5.28, PHP5.4 |
||
| Description |
|
Hello, i have got an error with doctrine 2.3.4 when i try to run the following code :
$conn->executeQuery(
'INSERT INTO FOO (foo, bar) values (:foo, :bar)',
array('foo' => 1, 'bar' => null)
);
This code worked with doctrine 2.3.3. I think the error comes from the function 'extractParam' in SQLParserUtils.php (DBAL)
line 215 : if (isset($paramsOrTypes[$paramName]))
The key exists even if the value is null.
if (array_key_exists($paramName, $paramsOrTypes))
I am not enough confident to try a PR. |
| Comments |
| Comment by Marco Pivetta [ 20/May/13 ] |
|
I suggested a hotfix at https://github.com/doctrine/dbal/pull/322 |
| Comment by lemeunier [ 21/May/13 ] |
|
Thanks for the hotfix. |