Skip to content

Commit 81d54a2

Browse files
committed
changes based on review
1 parent 2aa37a1 commit 81d54a2

File tree

3 files changed

+3
-7
lines changed

3 files changed

+3
-7
lines changed

packets.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -559,11 +559,8 @@ func (mc *mysqlConn) readColumns(count int) ([]mysqlField, error) {
559559

560560
// Filler [uint8]
561561
// Charset [charset, collation uint8]
562-
pos += n + 1 + 2
563-
564562
// Length [uint32]
565-
columns[i].length = binary.LittleEndian.Uint32(data[pos : pos+4])
566-
pos += 4
563+
pos += n + 1 + 2 + 4
567564

568565
// Field type [uint8]
569566
columns[i].fieldType = data[pos]

rows.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ import (
1515

1616
type mysqlField struct {
1717
name string
18-
length uint32 // length as string: DATETIME(4) => 24
1918
flags fieldFlag
2019
fieldType byte
21-
decimals byte // numeric precision: DATETIME(4) => 4, also for DECIMAL etc.
20+
decimals byte
2221
}
2322

2423
type mysqlRows struct {

utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ var (
3030
)
3131

3232
// timeFormat must not be changed
33-
var timeFormat = "2006-01-02 15:04:05.999999"
33+
const timeFormat = "2006-01-02 15:04:05.999999"
3434

3535
func init() {
3636
tlsConfigRegister = make(map[string]*tls.Config)

0 commit comments

Comments
 (0)