Skip to content

Commit

Permalink
Let the driver unescape type descriptions before parsing them
Browse files Browse the repository at this point in the history
  • Loading branch information
kvap committed Oct 10, 2018
1 parent c1dc41a commit 40ee60a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion conn_go18_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (s *connSuite) TestColumnTypes() {
s.Require().NoError(err)
expected := []string{
"Int64", "UInt64", "Float64", "String", "String", "Array(Int16)", "Array(UInt8)", "Date", "DateTime",
`Enum8(\'one\' = 1, \'two\' = 2, \'three\' = 3)`,
"Enum8('one' = 1, 'two' = 2, 'three' = 3)",
}
s.Require().Equal(len(expected), len(types))
for i, e := range expected {
Expand Down
6 changes: 6 additions & 0 deletions rows.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ func newTextRows(c *conn, body io.ReadCloser, location *time.Location, useDBLoca
if err != nil {
return nil, err
}
for i := range types {
types[i], err = readUnquoted(strings.NewReader(types[i]), 0)
if err != nil {
return nil, err
}
}

parsers := make([]DataParser, len(types), len(types))
for i, typ := range types {
Expand Down

0 comments on commit 40ee60a

Please sign in to comment.