Skip to content

Commit

Permalink
ast: remove unused code (#7521)
Browse files Browse the repository at this point in the history
  • Loading branch information
coocood authored and tiancaiamao committed Aug 29, 2018
1 parent 2fb3145 commit 3d468b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
29 changes: 5 additions & 24 deletions ast/expressions.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import (
"github.com/pingcap/tidb/model"
"github.com/pingcap/tidb/mysql"
"github.com/pingcap/tidb/parser/opcode"
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/types"
)

Expand Down Expand Up @@ -319,30 +318,15 @@ func (n *CaseExpr) Accept(v Visitor) (Node, bool) {
return v.Leave(n)
}

// SubqueryExec represents a subquery executor interface.
// This interface is implemented in executor and used in plan/evaluator.
// It will execute the subselect and get the result.
type SubqueryExec interface {
// EvalRows executes the subquery and returns the multi rows with rowCount.
// rowCount < 0 means no limit.
// If the ColumnCount is 1, we will return a column result like {1, 2, 3},
// otherwise, we will return a table result like {{1, 1}, {2, 2}}.
EvalRows(ctx sessionctx.Context, rowCount int) ([]types.Datum, error)

// ColumnCount returns column count for the sub query.
ColumnCount() (int, error)
}

// SubqueryExpr represents a subquery.
type SubqueryExpr struct {
exprNode
// Query is the query SelectNode.
Query ResultSetNode
SubqueryExec SubqueryExec
Evaluated bool
Correlated bool
MultiRows bool
Exists bool
Query ResultSetNode
Evaluated bool
Correlated bool
MultiRows bool
Exists bool
}

// Format the ExprNode into a Writer.
Expand All @@ -357,9 +341,6 @@ func (n *SubqueryExpr) Accept(v Visitor) (Node, bool) {
return v.Leave(newNode)
}
n = newNode.(*SubqueryExpr)
if n.SubqueryExec != nil {
return v.Leave(n)
}
node, ok := n.Query.Accept(v)
if !ok {
return n, false
Expand Down
12 changes: 0 additions & 12 deletions ast/misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import (

"github.com/pingcap/tidb/model"
"github.com/pingcap/tidb/mysql"
"github.com/pingcap/tidb/sessionctx"
"github.com/pingcap/tidb/util/auth"
)

Expand Down Expand Up @@ -787,17 +786,6 @@ type Ident struct {
Name model.CIStr
}

// Full returns an Ident which set schema to the current schema if it is empty.
func (i Ident) Full(ctx sessionctx.Context) (full Ident) {
full.Name = i.Name
if i.Schema.O != "" {
full.Schema = i.Schema
} else {
full.Schema = model.NewCIStr(ctx.GetSessionVars().CurrentDB)
}
return
}

// String implements fmt.Stringer interface.
func (i Ident) String() string {
if i.Schema.O == "" {
Expand Down

0 comments on commit 3d468b9

Please sign in to comment.