Prechádzať zdrojové kódy

changes based on review

Arne Hormann 11 rokov pred
rodič
commit
81d54a2bbf
3 zmenil súbory, kde vykonal 3 pridanie a 7 odobranie
  1. 1 4
      packets.go
  2. 1 2
      rows.go
  3. 1 1
      utils.go

+ 1 - 4
packets.go

@@ -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]

+ 1 - 2
rows.go

@@ -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 {

+ 1 - 1
utils.go

@@ -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)