From a52c54ab0d3cb13027b027966ab3b1cfdb55dd98 Mon Sep 17 00:00:00 2001 From: Harshit Gangal Date: Tue, 13 Feb 2024 20:43:56 +0530 Subject: [PATCH] fix typo and some refactor Signed-off-by: Harshit Gangal --- changelog/20.0/20.0.0/summary.md | 2 +- go/vt/sqlparser/ast.go | 6 +++--- go/vt/sqlparser/ast_funcs.go | 36 -------------------------------- 3 files changed, 4 insertions(+), 40 deletions(-) diff --git a/changelog/20.0/20.0.0/summary.md b/changelog/20.0/20.0.0/summary.md index 41fa729e165..f1280ba7e76 100644 --- a/changelog/20.0/20.0.0/summary.md +++ b/changelog/20.0/20.0.0/summary.md @@ -13,7 +13,7 @@ ## Major Changes -### Query Serving +### Query Compatibility #### Vindex Hints diff --git a/go/vt/sqlparser/ast.go b/go/vt/sqlparser/ast.go index 462fb227890..0e50d71b77c 100644 --- a/go/vt/sqlparser/ast.go +++ b/go/vt/sqlparser/ast.go @@ -55,9 +55,6 @@ type ( OrderAndLimit interface { AddOrder(*Order) - SetOrderBy(OrderBy) - GetOrderBy() OrderBy - GetLimit() *Limit SetLimit(*Limit) } @@ -76,6 +73,9 @@ type ( GetColumns() SelectExprs Commented IsDistinct() bool + GetOrderBy() OrderBy + SetOrderBy(OrderBy) + GetLimit() *Limit } // DDLStatement represents any DDL Statement diff --git a/go/vt/sqlparser/ast_funcs.go b/go/vt/sqlparser/ast_funcs.go index 276888e3da3..a8d231d6aa1 100644 --- a/go/vt/sqlparser/ast_funcs.go +++ b/go/vt/sqlparser/ast_funcs.go @@ -2606,34 +2606,10 @@ func MultiTable(node []TableExpr) bool { return !singleTbl } -func (node *Select) AddFrom(tbl TableExpr) { - node.From = append(node.From, tbl) -} - -func (node *Update) AddFrom(tbl TableExpr) { - node.TableExprs = append(node.TableExprs, tbl) -} - -func (node *Delete) AddFrom(tbl TableExpr) { - node.TableExprs = append(node.TableExprs, tbl) -} - func (node *Update) AddOrder(order *Order) { node.OrderBy = append(node.OrderBy, order) } -func (node *Update) SetOrderBy(by OrderBy) { - node.OrderBy = by -} - -func (node *Update) GetOrderBy() OrderBy { - return node.OrderBy -} - -func (node *Update) GetLimit() *Limit { - return node.Limit -} - func (node *Update) SetLimit(limit *Limit) { node.Limit = limit } @@ -2642,18 +2618,6 @@ func (node *Delete) AddOrder(order *Order) { node.OrderBy = append(node.OrderBy, order) } -func (node *Delete) SetOrderBy(by OrderBy) { - node.OrderBy = by -} - -func (node *Delete) GetOrderBy() OrderBy { - return node.OrderBy -} - -func (node *Delete) GetLimit() *Limit { - return node.Limit -} - func (node *Delete) SetLimit(limit *Limit) { node.Limit = limit }