Skip to content

Commit

Permalink
Merge pull request pingcap#7 from rebelice/dev_where
Browse files Browse the repository at this point in the history
fix no where
  • Loading branch information
crazycs520 authored Jan 6, 2022
2 parents bf88cdc + ea2f34c commit 0194b7b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions executor/table_reader.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,14 +128,16 @@ type RestoreData struct {

func (d *RestoreData) String() string {
var buffer bytes.Buffer
fmt.Fprint(&buffer, "select * from ")
fmt.Fprint(&buffer, `select * from "`)
fmt.Fprint(&buffer, d.DB)
fmt.Fprint(&buffer, ".")
fmt.Fprint(&buffer, `"."`)
fmt.Fprint(&buffer, d.Table)
fmt.Fprint(&buffer, " where ")
fmt.Fprint(&buffer, `"`)
for i, c := range d.Where {
if i != 0 {
fmt.Fprint(&buffer, " and ")
} else {
fmt.Fprint(&buffer, " where ")
}
fmt.Fprint(&buffer, c)
}
Expand Down
2 changes: 1 addition & 1 deletion expression/explain.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (expr *ScalarFunction) restore(t *model.TableInfo) string {
func (col *Column) Restore(t *model.TableInfo) string {
for _, c := range t.Columns {
if c.ID == col.ID {
return c.Name.L
return fmt.Sprintf(`"%v"`, c.Name.L)
}
}
return ""
Expand Down

0 comments on commit 0194b7b

Please sign in to comment.