Skip to content

Commit

Permalink
address nitpicks
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Jan 29, 2025
1 parent a92a324 commit 26df217
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2021 The Vitess Authors.
Copyright 2025 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
18 changes: 9 additions & 9 deletions go/vt/vtgate/vindexes/vschema.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const (
TypeTable = ""
TypeSequence = "sequence"
TypeReference = "reference"
TypeView = "view"
)

// VSchema represents the denormalized version of SrvVSchema,
Expand Down Expand Up @@ -497,15 +496,16 @@ func AddAdditionalGlobalTables(source *vschemapb.SrvVSchema, vschema *VSchema) {
// for sharded keyspace as well
for tname, table := range ksvschema.Views {
// Ignore tables already global (i.e. if specified in the vschema of an unsharded keyspace) or ambiguous.
if _, found := vschema.globalTables[tname]; !found {
_, ok := newTables[tname]
if !ok {
table.Keyspace = ksvschema.Keyspace
newTables[tname] = table
} else {
newTables[tname] = nil
}
if _, found := vschema.globalTables[tname]; found {
continue
}
_, ok := newTables[tname]
if ok {
newTables[tname] = nil
continue
}
table.Keyspace = ksvschema.Keyspace
newTables[tname] = table
}
// Sharded tables needs vindex information, adding to global table will not help.
if ks.Sharded {
Expand Down

0 comments on commit 26df217

Please sign in to comment.