Skip to content

Open Cypher - MERGE doesn't seem to match an existing vertex and tries to create it again #4089

Description

@teojqx

Environment:

  • Ran Docker container on Ubuntu
  • Was using version 26.4.2
  • All settings are in default

How I set up test schema to reproduce issue (using Studio):

  • Create vertex Type "Experiment"
  • Add property "pk" to Experiment, set Mandatory and Not Null to true
  • Add index on "pk", Index Algorithm is Hash, set Unique to true

Ran this command in Studio using Open Cypher:

MERGE (v:Experiment {pk: "a"})
ON CREATE SET v.status="created"
ON MATCH SET v.status="updated"
RETURN v

First run will create the vertex. Second run of same command will fail with the error Duplicated key [a] found on index 'Experiment[pk]' already assigned to record #80:0 due to the index on "pk" only allowing unique values. I was expecting it to update the "status" property to "updated" but it seems to try and create another vertex.

Image

I've also tested it on "latest" tag which was 26.5.1-SNAPSHOT (build e88e6e4/1778019236199/main) and still see this same issue.

Interestingly, when I tested it on previous 26.3.2 release, there was no issue. The MERGE successfully matches the vertex and updated it accordingly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions