hasbolt icon indicating copy to clipboard operation
hasbolt copied to clipboard

MERGE ON CREATE ON MATCH with more than 12 properties seems to cause a subsequent binary format decode error

Open esjmb opened this issue 3 years ago • 2 comments

consider a query of form

MERGE (x:SomeTag{a:"val1",b:"val"2,c:"val3"})
ON MATCH SET x.d = "val7", x.e = "val8", ... , x.z = "val9"
ON CREATE SET x.d = "val4", x.e = "val5", ... , x.z = "val6"

I seem to be hitting a limit of about 12 properties set before subsequent queries for nodes thus initialised results in a binary format decoding error, all using the Haskell hasbolt library. Less than this and all works fine.

A typical failing query would be:

MATCH (x:SomeTag{a:"val1",b:"val"2,c:"val3"}) RETURN x

results in

Cannot fetch: wrong message format (Error while decoding binary format: expected text)

This also seems to happen with SET += {12+ properties}

Happy to did in to diagnose, but just want to seek some commentary/guidance before I do.

thanks, S.

esjmb avatar Aug 06 '21 09:08 esjmb

A weird further development on this.

the issue arises only with commit dc8c1661dd3d021436cf60ebc9a3ac9a070bdf14, which is a commit that optimises binary encoding. It dos not arise with commit 97a063c42fb3f1d28abb7b2e24967338a021730e previous to it.

This matches my experience, which is that this issue only arose for us recently, with the error surfacing in code that was previously known to work fine.

esjmb avatar Aug 06 '21 16:08 esjmb

Hi @esjmb!

I would be happy to help with this, however I can't yet reproduce the issue. I tried creating a node in Neo4j first with

MERGE (x:SomeTag{a:"val1",b:"val2",c:"val3",d:"val4",e:"val5",f:"val6",g:"val7",h:"val8",i:"val9",j:"val10",k:"val11",l:"val12",m:"val13",o:"val14",p:"val15"}) RETURN x

Then querying this node with or without {....} with hasbolt does not produce any errors:

λ> run pipe $ query "MATCH (x:SomeTag) RETURN x"
[fromList [("x",S (Structure {signature = 78, fields = [I 1754,L [T "SomeTag"],M (fromList [("a",T "val1"),("b",T "val2"),("c",T "val3"),("d",T "val4"),("e",T "val5"),("f",T "val6"),("g",T "val7"),("h",T "val8"),("i",T "val9"),("j",T "val10"),("k",T "val11"),("l",T "val12"),("m",T "val13"),("o",T "val14"),("p",T "val15")])]}))],fromList [("x",S (Structure {signature = 78, fields = [I 3957,L [T "SomeTag"],M (fromList [("a",T "val1"),("b",T "val2"),("c",T "val3"),("d",T "val4"),("e",T "val5"),("f",T "val6"),("g",T "val7"),("h",T "val8"),("i",T "val9"),("j",T "val10"),("k",T "val11"),("l",T "val12"),("m",T "val13")])]}))]]

λ> run pipe $ query $ T.pack q
[fromList [("x",S (Structure {signature = 78, fields = [I 1754,L [T "SomeTag"],M (fromList [("a",T "val1"),("b",T "val2"),("c",T "val3"),("d",T "val4"),("e",T "val5"),("f",T "val6"),("g",T "val7"),("h",T "val8"),("i",T "val9"),("j",T "val10"),("k",T "val11"),("l",T "val12"),("m",T "val13"),("o",T "val14"),("p",T "val15")])]}))]]

Could you please provide a reproducing example?

maksbotan avatar Oct 30 '21 15:10 maksbotan