Merge pull request #1525 from dolthub/andy/faster-tag-validation

Andy/faster tag validation
This commit is contained in:
AndyA
2021-04-07 17:46:40 -07:00
committed by GitHub
3 changed files with 24 additions and 1 deletions

View File

@@ -18,7 +18,7 @@ require (
github.com/denisbrodbeck/machineid v1.0.1
github.com/dolthub/dolt/go/gen/proto/dolt/services/eventsapi v0.0.0-20201005193433-3ee972b1d078
github.com/dolthub/fslock v0.0.2
github.com/dolthub/go-mysql-server v0.9.1-0.20210407215342-cf396ae74c61
github.com/dolthub/go-mysql-server v0.9.1-0.20210407235314-7c641a48ecc2
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66
github.com/dolthub/sqllogictest/go v0.0.0-20201105013724-5123fc66e12c

View File

@@ -143,6 +143,8 @@ github.com/dolthub/fslock v0.0.2 h1:8vUh47iKovgrtXNrXVIzsIoWLlspoXg+3nslhUzgKSw=
github.com/dolthub/fslock v0.0.2/go.mod h1:0i7bsNkK+XHwFL3dIsSWeXSV7sykVzzVr6+jq8oeEo0=
github.com/dolthub/go-mysql-server v0.9.1-0.20210407215342-cf396ae74c61 h1:noGlmT++VHYsWt14Vl6v5UavA/OkW04/rxKmTHH7BiY=
github.com/dolthub/go-mysql-server v0.9.1-0.20210407215342-cf396ae74c61/go.mod h1:44ueL8vpS1wc/YN02RvRB+G0rjq1nC/IAKEoDPoEZbg=
github.com/dolthub/go-mysql-server v0.9.1-0.20210407235314-7c641a48ecc2 h1:MLJDS8q8nMGkP5SadwILP+vL0qFh2B4W0sYyZuBu4JM=
github.com/dolthub/go-mysql-server v0.9.1-0.20210407235314-7c641a48ecc2/go.mod h1:44ueL8vpS1wc/YN02RvRB+G0rjq1nC/IAKEoDPoEZbg=
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446 h1:0ol5pj+QlKUKAtqs1LiPM3ZJKs+rHPgLSsMXmhTrCAM=
github.com/dolthub/ishell v0.0.0-20210205014355-16a4ce758446/go.mod h1:dhGBqcCEfK5kuFmeO5+WOx3hqc1k3M29c1oS/R7N4ms=
github.com/dolthub/mmap-go v1.0.4-0.20201107010347-f9f2a9588a66 h1:WRPDbpJWEnPxPmiuOTndT+lUWUeGjx6eoNOK9O4tQQQ=

View File

@@ -1115,6 +1115,27 @@ func UnionTableNames(ctx context.Context, roots ...*RootValue) ([]string, error)
// validateTagUniqueness checks for tag collisions between the given table and the set of tables in then given root.
func validateTagUniqueness(ctx context.Context, root *RootValue, tableName string, table *Table) error {
prev, ok, err := root.GetTable(ctx, tableName)
if err != nil {
return err
}
if ok {
prevRef, err := prev.GetSchemaRef()
if err != nil {
return err
}
newRef, err := table.GetSchemaRef()
if err != nil {
return err
}
// short-circuit if schema unchanged
if prevRef.Equals(newRef) {
return nil
}
}
sch, err := table.GetSchema(ctx)
if err != nil {
return err