Skip to content

Commit

Permalink
fix: only clone types that implement SQLNode
Browse files Browse the repository at this point in the history
Signed-off-by: Andres Taylor <[email protected]>
  • Loading branch information
systay committed Jun 7, 2024
1 parent d0df621 commit 9d78ad3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions go/vt/schemadiff/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -1079,17 +1079,17 @@ func (s *Schema) getViewColumnNames(v *CreateViewEntity, schemaInformation *decl
case *sqlparser.StarExpr:
if tableName := node.TableName.Name.String(); tableName != "" {
for _, col := range schemaInformation.Tables[tableName].Columns {
name := sqlparser.Clone(&col.Name)
columnNames = append(columnNames, name)
name := sqlparser.Clone(col.Name)
columnNames = append(columnNames, &name)
}
} else {
dependentNames := getViewDependentTableNames(v.CreateView)
// add all columns from all referenced tables and views
for _, entityName := range dependentNames {
if schemaInformation.Tables[entityName] != nil { // is nil for dual/DUAL
for _, col := range schemaInformation.Tables[entityName].Columns {
name := sqlparser.Clone(&col.Name)
columnNames = append(columnNames, name)
name := sqlparser.Clone(col.Name)
columnNames = append(columnNames, &name)
}
}
}
Expand Down

0 comments on commit 9d78ad3

Please sign in to comment.