Skip to content

Commit

Permalink
fix the missing plan when tck mode is enabled (#214)
Browse files Browse the repository at this point in the history
* fix the missing plan when tck mode is enabled

* update go mod
  • Loading branch information
jievince authored Apr 4, 2023
1 parent 838a0eb commit 0dd79e2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
github.com/jievince/liner v1.2.4-0.20211229025353-9af8863139ef
github.com/kr/pretty v0.1.0 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230403093312-bf9fe21827d7
github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230404054219-3ed89268e97e
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68 // indirect
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230403093312-bf9fe21827d7 h1:jk0P5stIdXryHCtHUtPNs/c0aM8akBWaL0FycjCBtAA=
github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230403093312-bf9fe21827d7/go.mod h1:+sXv05jYQBARdTbTcIEsWVXCnF/6ttOlDK35xQ6m54s=
github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230404054219-3ed89268e97e h1:vOJo/AEKkDySSzCC8BPJWwSPpsXOvFDrU5VMwWg4q3A=
github.com/vesoft-inc/nebula-go/v3 v3.4.0-1.0.20230404054219-3ed89268e97e/go.mod h1:+sXv05jYQBARdTbTcIEsWVXCnF/6ttOlDK35xQ6m54s=
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sys v0.0.0-20180816055513-1c9583448a9c/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand Down
4 changes: 2 additions & 2 deletions printer/dataset_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (p *DataSetPrinter) PrintDataSet(res *nebula.ResultSet) {
p.writer.ResetHeaders()
p.writer.ResetRows()

if res.IsSetPlanDesc() && res.IsSetData() && "tck" == strings.ToLower(string(res.GetPlanDesc().GetFormat())) {
if res.IsSetPlanDesc() && strings.ToLower(string(res.GetPlanDesc().GetFormat())) == "tck" {
configWriterTckStyle(&p.writer)
}

Expand Down Expand Up @@ -102,7 +102,7 @@ func (p *DataSetPrinter) PrintDataSet(res *nebula.ResultSet) {
}

// Reset the writer style
if res.IsSetPlanDesc() && res.IsSetData() && "tck" == strings.ToLower(string(res.GetPlanDesc().GetFormat())) {
if res.IsSetPlanDesc() && strings.ToLower(string(res.GetPlanDesc().GetFormat())) == "tck" {
p.writer.SetStyle(table.StyleDefault)
configTableWriter(&p.writer, false)
}
Expand Down
2 changes: 1 addition & 1 deletion printer/plan_desc_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func (p *PlanDescPrinter) PrintPlanDesc(res *nebula.ResultSet) {
fmt.Println(p.renderDotGraphByStruct(s))
case "tck":
rows := res.MakePlanByTck()
s = p.renderByTck(rows)
fmt.Println(p.renderByTck(rows))
// Reset the writer style
p.writer.SetStyle(table.StyleDefault)
configTableWriter(&p.writer, true)
Expand Down

0 comments on commit 0dd79e2

Please sign in to comment.