Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jeromegn opened this issue May 20, 2024 · 0 comments
Open

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

jeromegn opened this issue May 20, 2024 · 0 comments

Comments

@jeromegn
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant