Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upgrade DCparser and fix lint issues #70

Merged
merged 1 commit into from
Sep 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions executor/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,9 @@ func (a *ExecStmt) Exec(ctx context.Context) (_ sqlexec.RecordSet, err error) {
if handled, result, err := a.handleNoDelay(ctx, e, isPessimistic); handled {
if returningRS != nil {
return returningRS, err
} else {
return result, err
}

return result, err
}

var txnStartTS uint64
Expand Down
5 changes: 5 additions & 0 deletions executor/returning.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
"github.com/pingcap/tidb/util/execdetails"
)

// ReturningExec represents Returning Executor
type ReturningExec struct {
baseExecutor

Expand All @@ -33,19 +34,23 @@ type ReturningExec struct {
ResultSet *recordSet
}

// Open Returning Executor
func (e *ReturningExec) Open(ctx context.Context) error {

return e.children[0].Open(ctx)
}

// Next Returning Executor
func (e *ReturningExec) Next(ctx context.Context, req *chunk.Chunk) error {
return e.fetchRowChunks(ctx)
}

// Close Returning Executor
func (e *ReturningExec) Close() error {
return e.children[0].Close()
}

// Returning Executor fetchRowChunks
func (e *ReturningExec) fetchRowChunks(ctx context.Context) error {
defer func() {
e.fetched = true
Expand Down
23 changes: 10 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/pingcap/tidb
require (
cloud.google.com/go v0.51.0 // indirect
github.com/BurntSushi/toml v0.3.1
github.com/DigitalChinaOpenSource/DCParser v0.0.0-20210825054110-e3314361a5f0
github.com/DigitalChinaOpenSource/DCParser v0.0.0-20210916075513-3aea1f464b37
github.com/DigitalChinaOpenSource/dcbr v4.0.11+incompatible
github.com/Jeffail/gabs/v2 v2.5.1
github.com/aws/aws-sdk-go v1.30.24 // indirect
Expand All @@ -30,7 +30,6 @@ require (
github.com/grpc-ecosystem/grpc-gateway v1.14.3 // indirect
github.com/iancoleman/strcase v0.0.0-20191112232945-16388991a334
github.com/jackc/pgio v1.0.0
github.com/jackc/pgproto3 v1.1.0
github.com/jackc/pgproto3/v2 v2.0.7
github.com/jackc/pgtype v1.6.2
github.com/klauspost/cpuid v1.2.1
Expand All @@ -50,11 +49,10 @@ require (
github.com/pingcap/fn v0.0.0-20200306044125-d5540d389059
github.com/pingcap/goleveldb v0.0.0-20191226122134-f82aafb29989
github.com/pingcap/kvproto v0.0.0-20201126113434-70db5fb4b0dc
github.com/pingcap/log v0.0.0-20201112100606-8f1e84a3abc8
github.com/pingcap/log v0.0.0-20210906054005-afc726e70354
github.com/pingcap/sysutil v0.0.0-20201130064824-f0c8aa6a6966
github.com/pingcap/tidb-tools v4.0.9-0.20201127090955-2707c97b3853+incompatible
github.com/pingcap/tipb v0.0.0-20200618092958-4fad48b4c8c3
github.com/pkg/errors v0.9.1
github.com/prometheus/client_golang v1.5.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.9.1
Expand All @@ -70,19 +68,18 @@ require (
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
go.etcd.io/bbolt v1.3.5 // indirect
go.etcd.io/etcd v0.5.0-alpha.5.0.20191023171146-3cf2f69b5738
go.uber.org/atomic v1.7.0
go.uber.org/atomic v1.9.0
go.uber.org/automaxprocs v1.2.0
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.16.0
go.uber.org/zap v1.19.1
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d // indirect
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208
golang.org/x/sys v0.0.0-20200819171115-d785dc25833f
golang.org/x/text v0.3.4
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
golang.org/x/sys v0.0.0-20210510120138-977fb7262007
golang.org/x/text v0.3.7
golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect
golang.org/x/tools v0.0.0-20200820010801-b793a1359eac
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
golang.org/x/tools v0.1.5
google.golang.org/api v0.15.1 // indirect
google.golang.org/genproto v0.0.0-20200108215221-bd8f9a0ef82f // indirect
google.golang.org/grpc v1.26.0
Expand Down
61 changes: 39 additions & 22 deletions go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions planner/core/initialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,13 @@ func (p PointGetPlan) Init(ctx sessionctx.Context, stats *property.StatsInfo, of
return &p
}

// Init LogicalReturning
func (p LogicalReturning) Init(ctx sessionctx.Context, offset int) *LogicalReturning {
p.baseLogicalPlan = newBaseLogicalPlan(ctx, plancodec.TypeReturning, &p, offset)
return &p
}

// Init PhysicalReturning
func (p PhysicalReturning) Init(ctx sessionctx.Context, stats *property.StatsInfo, offset int, props ...*property.PhysicalProperty) *PhysicalReturning {
p.basePhysicalPlan = newBasePhysicalPlan(ctx, plancodec.TypeReturning, &p, offset)
p.childrenReqProps = props
Expand Down
3 changes: 3 additions & 0 deletions planner/core/logical_plan_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -4386,6 +4386,9 @@ func (b *PlanBuilder) buildDelete(ctx context.Context, delete *ast.DeleteStmt) (
}

del.ReturningPlan, _, err = DoOptimize(ctx, b.ctx, b.optFlag, retPlan)
if err != nil {
return nil, err
}
}

return del, err
Expand Down
1 change: 1 addition & 0 deletions planner/core/logical_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -1265,6 +1265,7 @@ type LogicalReturning struct {
Count uint64
}

// SetParamType LogicalReturning
func (p *LogicalReturning) SetParamType(paramExprs *[]ast.ParamMarkerExpr) (err error) {
return err
}
1 change: 1 addition & 0 deletions planner/core/physical_plans.go
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,7 @@ type PhysicalReturning struct {
basePhysicalPlan
}

// SetParamType of PhysicalReturning
func (p *PhysicalReturning) SetParamType(paramExprs *[]ast.ParamMarkerExpr) (err error) {
return nil
}
2 changes: 2 additions & 0 deletions tools/check/go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
github.com/BurntSushi/toml v0.3.0 h1:e1/Ivsx3Z0FVTV0NSOv/aVgbUWyQuzj7DDnFblkRvsY=
github.com/BurntSushi/toml v0.3.0/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf h1:qet1QNfXsQxTZqLG4oE62mJzwPIB8+Tee4RNCL9ulrY=
Expand Down Expand Up @@ -100,6 +101,7 @@ golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgw
golang.org/x/tools v0.0.0-20190925020647-22afafe3322a h1:3GxqzBPBt1O2dIiPnzldQ5d25CAMWJFBZTpqxLPfjs8=
golang.org/x/tools v0.0.0-20190925020647-22afafe3322a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029041327-9cc4af7d6b2c/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5 h1:hKsoRgsbwY1NafxrwTs+k64bikrLBkAgPir1TNCj3Zs=
golang.org/x/tools v0.0.0-20191029190741-b9c20aec41a5/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
gopkg.in/alecthomas/gometalinter.v2 v2.0.12 h1:/xBWwtjmOmVxn8FXfIk9noV8m2E2Id9jFfUY/Mh9QAI=
Expand Down