[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)
     );

Error : Value for :bar not found in params array. Params array key should be "bar"

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.
So it should be:

  if (array_key_exists($paramName, $paramsOrTypes)) 

I am not enough confident to try a PR.
Thanks in advance!



 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.





[DBAL-524] [GH-322] DBAL-522 Created: 20/May/13  Updated: 21/May/13  Resolved: 21/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3.4
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of Ocramius:

Url: https://github.com/doctrine/dbal/pull/322

Message:

Hotfix for DBAL-522(http://www.doctrine-project.org/jira/browse/DBAL-522)

Demonstrates that NULL parameters are handled incorrectly by `Doctrine\DBAL\SqlParserUtils` as of 2.3.4.

Basically, following usage always throws an exception:

$conn->executeQuery(
    'INSERT INTO FOO (foo, bar) values (:foo, :bar)', 
    array('foo' => 1, 'bar' => null)
);


 Comments   
Comment by Doctrine Bot [ 21/May/13 ]

A related Github Pull-Request [GH-322] was closed:
https://github.com/doctrine/dbal/pull/322





[DBAL-523] [GH-321] Changed property visibility to protected Created: 20/May/13  Updated: 20/May/13  Resolved: 20/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of barnabywalters:

Url: https://github.com/doctrine/dbal/pull/321

Message:

The main reason being to allow QueryBuilder to be subclassed ��� for example so that we can fix issues like problematic shallow cloning locally and use them without having to wait for a pull request to be merged.



 Comments   
Comment by Doctrine Bot [ 20/May/13 ]

A related Github Pull-Request [GH-321] was closed:
https://github.com/doctrine/dbal/pull/321

Comment by Marco Pivetta [ 20/May/13 ]

Enforces BC on the internals of the QueryBuilder, which is a no-go given the complexity of the QueryBuilder itself





[DBAL-518] [GH-318] Update Type.php Created: 15/May/13  Updated: 17/May/13  Resolved: 17/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: None
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Marco Pivetta
Resolution: Won't Fix Votes: 0
Labels: None


 Description   

This issue is created automatically through a Github pull request on behalf of vincequeiroz:

Url: https://github.com/doctrine/dbal/pull/318

Message:

Camel case methods names.



 Comments   
Comment by Doctrine Bot [ 17/May/13 ]

A related Github Pull-Request [GH-318] was closed:
https://github.com/doctrine/dbal/pull/318





Generated at Wed May 22 22:40:29 UTC 2013 using JIRA 5.2.7#850-sha1:b2af0c8dc8537b36121c6a579fabbdf79fc919e5.