diff --git a/.czrc b/.czrc new file mode 100644 index 0000000000..d1bcc209ca --- /dev/null +++ b/.czrc @@ -0,0 +1,3 @@ +{ + "path": "cz-conventional-changelog" +} diff --git a/pkg/database/sql.go b/pkg/database/sql.go index 2c5de5a359..ee1afaafe6 100644 --- a/pkg/database/sql.go +++ b/pkg/database/sql.go @@ -437,7 +437,7 @@ func (d *db) SQLQueryPrepared(stmt *sql.SelectStmt, namedParams []*schema.NamedP Column: c.Column, Type: c.Type, } - cols[i] = &schema.Column{Name: des.Selector(), Type: des.Type} + cols[i] = &schema.Column{Name: des.Column, Type: des.Type} } res := &schema.SQLQueryResult{Columns: cols} diff --git a/pkg/stdlib/rows.go b/pkg/stdlib/rows.go index 1eb895b6de..c535964758 100644 --- a/pkg/stdlib/rows.go +++ b/pkg/stdlib/rows.go @@ -25,7 +25,6 @@ import ( "math" "reflect" "strconv" - "strings" "time" ) @@ -37,10 +36,7 @@ type Rows struct { func (r *Rows) Columns() []string { names := make([]string, 0) if len(r.rows) > 0 { - for _, n := range r.rows[0].Columns { - name := n[strings.LastIndex(n, ".")+1 : len(n)-1] - names = append(names, string(name)) - } + return r.rows[0].Columns } return names } diff --git a/pkg/stdlib/rows_test.go b/pkg/stdlib/rows_test.go index 1a353faa5e..223ae4202d 100644 --- a/pkg/stdlib/rows_test.go +++ b/pkg/stdlib/rows_test.go @@ -36,7 +36,7 @@ func TestRows(t *testing.T) { } ast := r.Columns() - require.Equal(t, "c", ast[0]) + require.Equal(t, "c1", ast[0]) st := r.ColumnTypeDatabaseTypeName(1) require.Equal(t, "", st) num, b := r.ColumnTypeLength(1)