Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues preventing the use of Bolt v5 #9

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

johannessen
Copy link

@majensen

Addresses majensen/perlbolt#54.

Resolves #3. (I did not, however, look into the segfault related to mangled failure codes.)

Comparing lib/src/messages.c with <https://neo4j.com/docs/bolt/current/bolt/message/#messages-summary>, it seems that this set of supported versions is a more accurate description of what is actually implemented. In particular, the messages LOGON and LOGOFF appear to be unavailable, so Bolt version 5.1 and newer will cause problems.

According to <https://neo4j.com/docs/bolt/current/bolt-compatibility/>, Bolt versions 5.0 and 4.0 enjoy full support by the current community server versions (Neo4j 5.16 / 4.4).
Trying to read actual element IDs received over Bolt v5 caused assertion failures in neo4j_node_elementid() and friends. According to the Bolt v5 protocol structure semantics, element IDs are transferred as strings. Because struct_deserialize() left them as NEO4J_STRING, reading out the element IDs failed as other code expects them to be NEO4J_ELEMENTID.

The issue doesn't show up on earlier Bolt versions because for those versions, the element IDs are synthesized from legacy numeric IDs during deserialisation. That special case uses the correct neo4j_value type NEO4J_ELEMENTID to begin with.

This change replaces the NEO4J_STRING neo4j_value type metadata of received element ID strings with NEO4J_ELEMENTID. The underlying string is not touched.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure to connect to Neo4j 5.9 (bolt_agent missing)
1 participant