florinpatrascu / bolt_sips

Neo4j driver for Elixir
Apache License 2.0
256 stars 49 forks source link

Problem with negative integers #42

Closed wavewizard closed 6 years ago

wavewizard commented 6 years ago

Hi Florin, thank you for the efforts you are putting in to this project.

Today I`ve seen a strange behaviour when using bolt_sips driver. It somewhat gives wrong result when there are negative integers on neo4j. for example: an integer which value is -1 become 256 and -256 becomes 65280 in bolt_sips query result.

It seems bolt_sips does not interpret neo4j`s negative integers.

florinpatrascu commented 6 years ago

@wavewizard - thank you for the bug report!

@mschae - would you please double check Boltex, the Boltex.PackStream.decode/1, in case you can spare some time? Boltex returns 255 for -1. Simple test:

iex> Boltex.test('localhost',7687, "return -1 as n")
[success: %{"fields" => ["n"], "result_available_after" => 3}, record: [255],
 success: %{"result_consumed_after" => 0, "type" => "r"}]

The encoder is correct.

Thank you both!

mschae commented 6 years ago

Wow this completely slipped by, sorry.

Will add negative integers asap, sorry about that

mschae commented 6 years ago

@florinpatrascu Can you verify that my latest master fixes negative integers? If that's so I'll release a new version. Sorry for the delay.

florinpatrascu commented 6 years ago

yep, the master branch is the fix :) Thank you, @mschae! I'll push a new release as soon release you have time to publish the master.

mschae commented 6 years ago

@florinpatrascu Just published 0.4.1 with the fix. Thanks for the report!

florinpatrascu commented 6 years ago

Thank you both, @mschae and @wavewizard! Negative numbers are in, now =)

@wavewizard - please use the latest bolt_sips version, from the master branch.