Skip to content

Bug: Segmentation fault matching on unwound results #460

Description

@Brad-Edwards

Imported from kuzudb/kuzu#6048
Original URL: kuzudb#6048
Original author: @mdbenito
Original created at: 2025-10-05T14:25:38Z
Kuzu v0.11.2, Ubuntu 24.04

Create a db with a duplicate edge

CREATE NODE TABLE Person(name STRING PRIMARY KEY);
CREATE REL TABLE LivesWith(FROM Person TO Person);
CREATE (p:Person {name: 'Alice'});
CREATE (p:Person {name: 'Bob'});
MATCH (p:Person {name: 'Alice'}), (q:Person {name: 'Bob'}) CREATE (p)-[:LivesWith]->(q);
MATCH (p:Person {name: 'Alice'}), (q:Person {name: 'Bob'}) CREATE (p)-[:LivesWith]->(q);

Then try to delete duplicate edges with the following query:

MATCH (a)-[r:LivesWith]->(b)
WITH collect(r) AS rs
WITH rs[2:] AS dups
UNWIND dups AS d
MATCH (a)-[s:LivesWith]->(b)
WHERE s=d
DELETE s;

On my system this fails with

Segmentation fault (core dumped)

(As a side note, it would be nice to be able to just DELETE d, but the binder refuses with Error: Binder exception: Cannot delete expression d with type VARIABLE. Expect node or rel pattern.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions