mschae / boltex

Elixir driver for the neo4j bolt protocol
Other
29 stars 6 forks source link

Boltex.Bolt.generate_chunks fails with too much data #13

Closed adri closed 7 years ago

adri commented 7 years ago

Hi, first of all thank you very much for this project!

When running a query with parameters I encountered the following error message:

(FunctionClauseError) no function clause matching in Boltex.Bolt.generate_chunks/3
    (bolt_sips) lib/boltex/bolt.ex:115: Boltex.Bolt.generate_chunks([<<178, 16, 209, 7, 244, 77, 69, 82, 71, 69, 32, 40, 103, 105, 116, 104, 117, 98, 58, 71, 105, 116, 104, 117, 98, 80, 114, 111, 102, 105, 108, 101, 32, 123, 32, 103, 105, 116, 104, 117, 98, 73, 100, 58, 32, 36, 117, 115, 101, ...>>, <<177, 63, 192>>], [], "")
    (bolt_sips) lib/boltex/bolt.ex:102: Boltex.Bolt.send_messages/3
    (bolt_sips) lib/boltex/bolt.ex:157: Boltex.Bolt.run_statement/4

With a larger amount of parameters it seems like generating chunks isn't working correctly. Unfortunately I wasn't able to find the exact size.

What I saw is that on this line the chunks variable is mentioned twice in the function signature. Could that be an issue?

mschae commented 7 years ago

@adri,

Thanks for your report and kind words and sorry you are seeing issues.

The double use of chunks is pretty stupid. Sorry about that.

Would it be possible for you to throw together a quick example project where you have a failing call? I played around a little but couldn't manage myself.

Once I have an easy way to reproduce I'm happy to fix this asap!

Thanks for your help, Michael

adri commented 7 years ago

Ok cool, I will try to come up with an example the next days. Not sure when I will find the time.