Skip to content

Commit

Permalink
rename TableSubquery to OutputsTable
Browse files Browse the repository at this point in the history
Signed-off-by: Florent Poinsard <[email protected]>
  • Loading branch information
frouioui committed Jan 14, 2025
1 parent 51002fb commit 9aee8b9
Show file tree
Hide file tree
Showing 37 changed files with 351 additions and 349 deletions.
2 changes: 1 addition & 1 deletion go/test/endtoend/vtgate/queries/random/query_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ type (

// queryGenerator generates queries, which can either be unions or select statements
queryGenerator struct {
stmt sqlparser.SelectStatement
stmt sqlparser.OutputsTable
selGen *selectGenerator
}

Expand Down
4 changes: 2 additions & 2 deletions go/test/endtoend/vtgate/queries/random/simplifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ func simplifyResultsMismatchedQuery(t *testing.T, query string) string {
require.NoError(t, err)

simplified := simplifier.SimplifyStatement(
stmt.(sqlparser.SelectStatement),
stmt.(sqlparser.OutputsTable),
vSchemaWrapper.CurrentDb(),
vSchemaWrapper,
func(statement sqlparser.SelectStatement) bool {
func(statement sqlparser.OutputsTable) bool {
q := sqlparser.String(statement)
_, newErr := mcmp.ExecAllowAndCompareError(q, utils.CompareOptions{})
if newErr == nil {
Expand Down
2 changes: 1 addition & 1 deletion go/test/vschemawrapper/vschema_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ func (vw *VSchemaWrapper) FindTable(tab sqlparser.TableName) (*vindexes.Table, s
return table, destKeyspace, destTabletType, destTarget, nil
}

func (vw *VSchemaWrapper) FindView(tab sqlparser.TableName) sqlparser.TableSubquery {
func (vw *VSchemaWrapper) FindView(tab sqlparser.TableName) sqlparser.OutputsTable {
destKeyspace, _, _, err := topoproto.ParseDestination(tab.Qualifier.String(), topodatapb.TabletType_PRIMARY)
if err != nil {
return nil
Expand Down
22 changes: 11 additions & 11 deletions go/vt/sqlparser/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ type (
GetLimit() *Limit
}

TableSubquery interface {
iTableSubquery()
OutputsTable interface {
iOutputsTable()

InsertRows
Statement
Expand Down Expand Up @@ -184,7 +184,7 @@ type (
CommonTableExpr struct {
ID IdentifierCS
Columns Columns
Subquery TableSubquery
Subquery OutputsTable
}
// ChangeColumn is used to change the column definition, can also rename the column in alter table command
ChangeColumn struct {
Expand Down Expand Up @@ -326,8 +326,8 @@ type (
// Union represents a UNION statement.
Union struct {
With *With
Left TableSubquery
Right TableSubquery
Left OutputsTable
Right OutputsTable
Distinct bool
OrderBy OrderBy
Limit *Limit
Expand Down Expand Up @@ -566,7 +566,7 @@ type (
Definer *Definer
Security string
Columns Columns
Select TableSubquery
Select OutputsTable
CheckOption string
IsReplace bool
Comments *ParsedComments
Expand All @@ -579,7 +579,7 @@ type (
Definer *Definer
Security string
Columns Columns
Select TableSubquery
Select OutputsTable
CheckOption string
Comments *ParsedComments
}
Expand Down Expand Up @@ -775,10 +775,10 @@ func (*Analyze) iStatement() {}
func (*OtherAdmin) iStatement() {}
func (*CommentOnly) iStatement() {}
func (*Select) iSelectStatement() {}
func (*Select) iTableSubquery() {}
func (*Select) iOutputsTable() {}
func (*ValuesStatement) iSelectStatement() {}
func (*Union) iSelectStatement() {}
func (*Union) iTableSubquery() {}
func (*Union) iOutputsTable() {}
func (*Load) iStatement() {}
func (*CreateDatabase) iStatement() {}
func (*AlterDatabase) iStatement() {}
Expand Down Expand Up @@ -2137,13 +2137,13 @@ type (

// Subquery represents a subquery used as an value expression.
Subquery struct {
Select TableSubquery
Select OutputsTable
}

// DerivedTable represents a subquery used as a table expression.
DerivedTable struct {
Lateral bool
Select TableSubquery
Select OutputsTable
}
)

Expand Down
50 changes: 25 additions & 25 deletions go/vt/sqlparser/ast_clone.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

60 changes: 30 additions & 30 deletions go/vt/sqlparser/ast_copy_on_rewrite.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 9aee8b9

Please sign in to comment.