@@ -559,11 +559,8 @@ func (mc *mysqlConn) readColumns(count int) ([]mysqlField, error) {
// Filler [uint8]
// Charset [charset, collation uint8]
- pos += n + 1 + 2
-
// Length [uint32]
- columns[i].length = binary.LittleEndian.Uint32(data[pos : pos+4])
- pos += 4
+ pos += n + 1 + 2 + 4
// Field type [uint8]
columns[i].fieldType = data[pos]
@@ -15,10 +15,9 @@ import (
type mysqlField struct {
name string
- length uint32 // length as string: DATETIME(4) => 24
flags fieldFlag
fieldType byte
- decimals byte // numeric precision: DATETIME(4) => 4, also for DECIMAL etc.
+ decimals byte
}
type mysqlRows struct {
@@ -30,7 +30,7 @@ var (
)
// timeFormat must not be changed
-var timeFormat = "2006-01-02 15:04:05.999999"
+const timeFormat = "2006-01-02 15:04:05.999999"
func init() {
tlsConfigRegister = make(map[string]*tls.Config)