mirror of
https://github.com/dolthub/dolt.git
synced 2026-04-20 02:24:58 -05:00
Merge pull request #1825 from dolthub/zachmu/1824
Skipped bats test for #1824
This commit is contained in:
@@ -2366,6 +2366,43 @@ SQL
|
||||
[[ "${#lines[@]}" = "3" ]] || false
|
||||
}
|
||||
|
||||
@test "index: Merge into branch without index from branch with index" {
|
||||
dolt sql <<SQL
|
||||
CREATE TABLE test (
|
||||
pk bigint PRIMARY KEY,
|
||||
v1 bigint,
|
||||
v2 bigint
|
||||
);
|
||||
INSERT INTO test VALUES (1, 1, 1);
|
||||
SQL
|
||||
dolt add -A
|
||||
dolt commit -m "baseline"
|
||||
dolt branch other
|
||||
dolt sql -q "INSERT INTO test VALUES (2, 2, 2);"
|
||||
dolt add -A
|
||||
dolt commit -m "baseline"
|
||||
dolt checkout other
|
||||
dolt sql -q "CREATE INDEX abc ON test (v1)"
|
||||
dolt add -A
|
||||
dolt commit -m "added index"
|
||||
dolt checkout master
|
||||
|
||||
skip "https://github.com/dolthub/dolt/issues/1824"
|
||||
|
||||
dolt merge other
|
||||
run dolt sql -q "select * from test where v1 = 2" -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "pk,v1,v2" ]] || false
|
||||
[[ "$output" =~ "2,2,2" ]] || false
|
||||
[[ "${#lines[@]}" = "2" ]] || false
|
||||
run dolt index cat test abc -r=csv
|
||||
[ "$status" -eq "0" ]
|
||||
[[ "$output" =~ "v1,pk" ]] || false
|
||||
[[ "$output" =~ "1,1" ]] || false
|
||||
[[ "$output" =~ "2,2" ]] || false
|
||||
[[ "${#lines[@]}" = "3" ]] || false
|
||||
}
|
||||
|
||||
@test "index: Overwriting index auto-generated by foreign key" {
|
||||
dolt sql <<SQL
|
||||
CREATE TABLE parent (
|
||||
@@ -2515,4 +2552,4 @@ SQL
|
||||
run dolt sql -r csv -q "SELECT * FROM mytable"
|
||||
[[ "$output" =~ "1,jon" ]] || false
|
||||
! [[ "$output" =~ "2,jon" ]] || false
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user