Skip to content

Commit

Permalink
test: update expectations now that unknown is a keyword
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Apr 8, 2024
1 parent 4077adc commit e9365a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go/vt/vtgate/executor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -588,14 +588,14 @@ func TestExecutorShow(t *testing.T) {
_, err = executor.Execute(ctx, nil, "TestExecute", session, fmt.Sprintf("show create table %v.unknown", KsTestUnsharded), nil)
require.NoError(t, err)
lastQuery = sbclookup.Queries[len(sbclookup.Queries)-1].Sql
wantQuery = "show create table unknown"
wantQuery = "show create table `unknown`"
assert.Equal(t, wantQuery, lastQuery, "Got: %v. Want: %v", lastQuery, wantQuery)

// SHOW KEYS with two different syntax
_, err = executor.Execute(ctx, nil, "TestExecute", session, fmt.Sprintf("show keys from %v.unknown", KsTestUnsharded), nil)
require.NoError(t, err)
lastQuery = sbclookup.Queries[len(sbclookup.Queries)-1].Sql
wantQuery = "show indexes from unknown"
wantQuery = "show indexes from `unknown`"
assert.Equal(t, wantQuery, lastQuery, "Got: %v. Want: %v", lastQuery, wantQuery)

_, err = executor.Execute(ctx, nil, "TestExecute", session, fmt.Sprintf("show keys from unknown from %v", KsTestUnsharded), nil)
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/planbuilder/testdata/ddl_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@
"Name": "main",
"Sharded": false
},
"Query": "alter table unknown add key a (id)"
"Query": "alter table `unknown` add key a (id)"
},
"TablesUsed": [
"main.unknown"
Expand Down
2 changes: 1 addition & 1 deletion go/vt/vtgate/planbuilder/testdata/show_cases.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@
"Sharded": false
},
"TargetDestination": "AnyShard()",
"Query": "show create table unknown",
"Query": "show create table `unknown`",
"SingleShardOnly": true
}
}
Expand Down

0 comments on commit e9365a8

Please sign in to comment.