neo4j-php / neo4j-php-client

Php client and driver for neo4j database
https://neo4j.com/developer/php/
MIT License
165 stars 41 forks source link

Getting different results to the same query from Bolt and HTTP protocols #31

Closed jac12498 closed 3 years ago

jac12498 commented 3 years ago

I have the following code:

$statement = new \Laudis\Neo4j\Databags\Statement($query, $params);
$vector = $this->connection->runStatement($statement);

$query = "merge(u:User{email: $email}) on create set u.uuid=$uuid return u'; $params = ['email' => "a@b.c", 'uuid' => 'cc60fd69-a92b-47f3-9674-2f27f3437d66'];

Using HTTP, I get the following returned as $vector: object(Ds\Vector)#54 (1) { [0]=> object(Ds\Map)#55 (1) { [0]=> object(Ds\Pair)#52 (2) { ["key"]=> string(1) "n" ["value"]=> array(2) { ["uuid"]=> string(36) "35a1a9f0-173f-4899-b2a6-fe66b9e46a79" ["email"]=> string(5) "a@b.c" } } } }

Using Bolt, I get the following returned as $vector: object(Ds\Vector)#59 (0) { }

The node is created (assuming it did not exist before) with both protocols.

jac12498 commented 3 years ago

Still happening.

transistive commented 3 years ago

Hello @jac12498,

Thank you for taking the time out of your day to report this issue. I have run your query over neo4j version 42, 41, 40 and 35 without any issues, as you can see at the commit referencing the issue.

My spider senses are tingling and telling me you might be testing this with PHPUnit. If this is the case, there is a weird interaction at the moment between php-ds and PHPUnit as you can read about here: https://github.com/php-ds/ext-ds/issues/122.

If this is not the case, I will need some more information before being able to help you.

Let's hope we can swiftly fix this.

Kind regards,

Ghlen

jac12498 commented 3 years ago

Thank you for your response.

I have reduced my test to the bare essentials and everything works correctly. The issue must be something with my code. Apologizes for not analyzing it more carefully before.

transistive commented 3 years ago

No problem! Good luck with your project :smile: