diff --git a/.travis.yml b/.travis.yml index a4236330b..0bfd17597 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,6 @@ sudo: false language: go go: - - 1.4 - 1.5 - 1.6 - 1.7 diff --git a/AUTHORS b/AUTHORS index 5f27aa457..58c749e29 100644 --- a/AUTHORS +++ b/AUTHORS @@ -12,6 +12,7 @@ # Individual Persons Aaron Hopkins +Achille Roussel Arne Hormann Asta Xie Bulat Gaifullin diff --git a/README.md b/README.md index 5a8937aa7..bfe40e15d 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ A MySQL-Driver for Go's [database/sql](https://golang.org/pkg/database/sql/) pac * Optional placeholder interpolation ## Requirements - * Go 1.4 or higher + * Go 1.5 or higher * MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+) --------------------------------------- diff --git a/packets.go b/packets.go index a76292488..9715067c4 100644 --- a/packets.go +++ b/packets.go @@ -1078,17 +1078,19 @@ func (stmt *mysqlStmt) writeExecutePacket(args []driver.Value) error { paramTypes[i+i] = fieldTypeString paramTypes[i+i+1] = 0x00 - var val []byte + var a [64]byte + var b = a[:0] + if v.IsZero() { - val = []byte("0000-00-00") + b = append(b, "0000-00-00"...) } else { - val = []byte(v.In(mc.cfg.Loc).Format(timeFormat)) + b = v.In(mc.cfg.Loc).AppendFormat(b, timeFormat) } paramValues = appendLengthEncodedInteger(paramValues, - uint64(len(val)), + uint64(len(b)), ) - paramValues = append(paramValues, val...) + paramValues = append(paramValues, b...) default: return fmt.Errorf("can not convert type: %T", arg)