Skip to content

Recursive query on a mount from parent of mountpoint produces incorrect results #677

@SanderMertens

Description

@SanderMertens

Recursive queries do not produce correct results when the result includes objects from a mount that is mounted on a child of the from clause. The following code demonstrates the scenario:

corto_mount m = corto_subscribe("//")
    .from("/data/mounted")
    .mount(corto_mount_o, NULL, NULL);

corto_select("//").from("/data").iter(&it)

The mount is matched when corto_select evaluates /data. When computing the relative mount query from /data and /data/mounted, the resulting from is set to ., which is correct. However, when a mount then returns an object with, for example, id x, this id is then added to the corto_select location as /data/x and not /data/mounted/x.

When computing the next mount query, the relative parent from /data/x and /data/mounted will still evaluate to ., which results in the exact same query being made to the mount. This process will repeat a few times which eventually yields undefined results.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions