mirror of
https://github.com/dolthub/dolt.git
synced 2026-03-13 01:54:38 -05:00
Test for auto increment on a newly cloned database
This commit is contained in:
@@ -776,3 +776,43 @@ SQL
|
||||
[[ "$output" =~ "5,5" ]] || false
|
||||
[[ "$output" =~ "6,6" ]] || false
|
||||
}
|
||||
|
||||
@test "auto_increment: newly cloned database" {
|
||||
dolt sql <<SQL
|
||||
call dolt_add('.');
|
||||
call dolt_commit('-am', 'empty table');
|
||||
call dolt_branch('branch1');
|
||||
call dolt_branch('branch2');
|
||||
|
||||
insert into test (c0) values (1), (2);
|
||||
call dolt_commit('-am', 'main values');
|
||||
|
||||
call dolt_checkout('branch1');
|
||||
insert into test (c0) values (3), (4);
|
||||
call dolt_commit('-am', 'branch1 values');
|
||||
|
||||
call dolt_checkout('branch2');
|
||||
insert into test (c0) values (5), (6);
|
||||
call dolt_commit('-am', 'branch2 values');
|
||||
SQL
|
||||
|
||||
dolt remote add remote1 file://./remote1
|
||||
dolt push remote1 main
|
||||
dolt push remote1 branch1
|
||||
dolt push remote1 branch2
|
||||
|
||||
dolt clone file://./remote1 clone
|
||||
cd clone
|
||||
|
||||
# The clone should find the values on the remote branches that haven't been
|
||||
# checked out locally
|
||||
dolt sql <<SQL
|
||||
insert into test (c0) values (7), (8);
|
||||
SQL
|
||||
|
||||
run dolt sql -q 'select * from test' -r csv
|
||||
[ $status -eq 0 ]
|
||||
[[ "$output" =~ "7,7" ]] || false
|
||||
[[ "$output" =~ "8,8" ]] || false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user