Skip to content

MemoryDB: Building non-unique indexes is nondeterministic #2877

@nicktobey

Description

@nicktobey

Repro:

create table test(c0 int not null, c1 int not null, pk int primary key, key (c0, c1));
insert into test values (2, 3, 1), (5, 6, 4), (2, 3, 7);",
select * from test where c0 = 2 and c1 = 3;

The iteration order of the select varies each time the index is built. Usually the row (2, 3, 1) is returned first, but occasionally the row (2, 3, 7) is returned first instead.

I imagine this is happening because we're iterating over a golang map at some point during index building.

This can cause issues because it can lead to the memory DB having different behavior from Dolt, which complicates writing Dolt tests.

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