Unblock Update Tests and add new bats test for Update Join #2274

This commit is contained in:
Vinai Rachakonda
2021-10-20 16:58:27 -07:00
committed by GitHub
parent 1cc0df7c5c
commit 4d50597424
2 changed files with 12 additions and 8 deletions

View File

@@ -169,7 +169,6 @@ func TestReplaceIntoErrors(t *testing.T) {
}
func TestUpdate(t *testing.T) {
t.Skip("Broken on GMS main, vinai@ to fix")
enginetest.TestUpdate(t, newDoltHarness(t))
}

View File

@@ -1486,14 +1486,19 @@ SQL
[ "${lines[20]}" = "20" ]
}
@test "sql: update against joins fail with error" {
skip "broken on main"
dolt sql -q "CREATE TABLE mytable(pk int primary key, val int);"
@test "sql: simple update against join works" {
dolt sql -q "CREATE TABLE test(pk int primary key, val int);"
dolt sql -q "INSERT INTO test values (1,1)"
run dolt sql -q "UPDATE mytable one, mytable two SET one.val = 1 WHERE one.pk = two.pk + 1;"
[ "$status" -ne 0 ]
[[ "$output" =~ "table doesn't support UPDATE" ]] || false
dolt sql -q "CREATE TABLE test2(pk int primary key)"
dolt sql -q "insert into test2 values (1)"
run dolt sql -q "UPDATE test INNER JOIN test2 on test.pk = test2.pk set val = 2"
[ "$status" -eq 0 ]
run dolt sql -r csv -q "SELECT * FROM test"
[ "$status" -eq 0 ]
[[ "$output" =~ "1,2" ]] || false
}
# regression test for query errors involving partial and full index matches