Skip to content

Missing seq of 0 in some cases (maybe just INSERT OR REPLACE INTO) #431

@jeromegn

Description

@jeromegn

Reproduction:

sqlite> create table foo (id int not null primary key, text text, text2 text, num int, num2 int);
sqlite> select crsql_as_crr('foo');
OK
sqlite> insert into foo values (1, 'foo', 'bar', 2, 3);
sqlite> .mode col
sqlite> select * from foo__crsql_clock;
key  col_name  col_version  db_version  site_id  seq
---  --------  -----------  ----------  -------  ---
1    num       1            1           0        2
1    num2      1            1           0        3
1    text      1            1           0        0
1    text2     1            1           0        1
sqlite> insert or replace into foo values (1, 'foo2', 'bar2', 4, 5);
sqlite> select * from foo__crsql_clock;
key  col_name  col_version  db_version  site_id  seq
---  --------  -----------  ----------  -------  ---
1    num       2            2           0        3
1    num2      2            2           0        4
1    text      2            2           0        1
1    text2     2            2           0        2

db_version 2 does not have a seq with a value of 0.

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