Skip to content

Commit 0803985

Browse files
committed
bufix: buildresultset
1 parent a75b175 commit 0803985

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

proxy/conn_resultset.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,8 @@ func (c *Conn) buildResultset(names []string, values [][]interface{}) (*Resultse
7878
row = row[0:0]
7979
for j, value := range vs {
8080
if i == 0 {
81-
field := r.Fields[j]
81+
field := &Field{}
82+
r.Fields[j] = field
8283
field.Name = hack.Slice(names[j])
8384

8485
if err = formatField(field, value); err != nil {

proxy/conn_show.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func (c *Conn) handleShowDatabases() (*Resultset, error) {
3434
dbs = append(dbs, key)
3535
}
3636

37-
return c.buildShowResultset(dbs, "Database")
37+
return c.buildSimpleShowResultset(dbs, "Database")
3838
}
3939

4040
func (c *Conn) handleShowTables(sql string, stmt *sqlparser.Show) (*Resultset, error) {
@@ -82,10 +82,10 @@ func (c *Conn) handleShowTables(sql string, stmt *sqlparser.Show) (*Resultset, e
8282
values[i] = tables[i]
8383
}
8484

85-
return c.buildShowResultset(values, fmt.Sprintf("Tables_in_%s", s.db))
85+
return c.buildSimpleShowResultset(values, fmt.Sprintf("Tables_in_%s", s.db))
8686
}
8787

88-
func (c *Conn) buildShowResultset(values []interface{}, name string) (*Resultset, error) {
88+
func (c *Conn) buildSimpleShowResultset(values []interface{}, name string) (*Resultset, error) {
8989

9090
r := new(Resultset)
9191

0 commit comments

Comments
 (0)