Bump deps

This commit is contained in:
Jeff Mitchell
2017-05-24 09:40:58 -04:00
parent 0828b565c3
commit d468da79e0
461 changed files with 39725 additions and 44040 deletions

View File

@@ -13,6 +13,7 @@
Aaron Hopkins <go-sql-driver at die.net>
Arne Hormann <arnehormann at gmail.com>
Asta Xie <xiemengjun at gmail.com>
Carlos Nieto <jose.carlos at menteslibres.net>
Chris Moos <chris at tech9computers.com>
Daniel Nichter <nil at codenode.com>
@@ -31,10 +32,12 @@ Jian Zhen <zhenjl at gmail.com>
Joshua Prunier <joshua.prunier at gmail.com>
Julien Lefevre <julien.lefevr at gmail.com>
Julien Schmidt <go-sql-driver at julienschmidt.com>
Justin Nuß <nuss.justin at gmail.com>
Kamil Dziedzic <kamil at klecza.pl>
Kevin Malachowski <kevin at chowski.com>
Lennart Rudolph <lrudolph at hmc.edu>
Leonardo YongUk Kim <dalinaum at gmail.com>
Lion Yang <lion at aosc.xyz>
Luca Looz <luca.looz92 at gmail.com>
Lucas Liu <extrafliu at gmail.com>
Luke Scott <luke at webconnex.com>

View File

@@ -272,7 +272,6 @@ func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, err
return nil, err
}
query = prepared
args = nil
}
mc.affectedRows = 0
mc.insertId = 0
@@ -330,7 +329,6 @@ func (mc *mysqlConn) Query(query string, args []driver.Value) (driver.Rows, erro
return nil, err
}
query = prepared
args = nil
}
// Send command
err := mc.writeCommandPacketStr(comQuery, query)

View File

@@ -4,7 +4,7 @@
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at http://mozilla.org/MPL/2.0/.
// Package mysql provides a MySQL driver for Go's database/sql package
// Package mysql provides a MySQL driver for Go's database/sql package.
//
// The driver should be used via the database/sql package:
//

View File

@@ -494,6 +494,10 @@ func parseDSNParams(cfg *Config, params string) (err error) {
if boolValue {
cfg.TLSConfig = "true"
cfg.tls = &tls.Config{}
host, _, err := net.SplitHostPort(cfg.Addr)
if err == nil {
cfg.tls.ServerName = host
}
} else {
cfg.TLSConfig = "false"
}

View File

@@ -147,7 +147,8 @@ func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
}
// send content packets
if err == nil {
// if packetSize == 0, the Reader contains no data
if err == nil && packetSize > 0 {
data := make([]byte, 4+packetSize)
var n int
for err == nil {

View File

@@ -486,23 +486,24 @@ func (mc *mysqlConn) readResultOK() ([]byte, error) {
plugin := string(data[1:pluginEndIndex])
cipher := data[pluginEndIndex+1 : len(data)-1]
if plugin == "mysql_old_password" {
switch plugin {
case "mysql_old_password":
// using old_passwords
return cipher, ErrOldPassword
} else if plugin == "mysql_clear_password" {
case "mysql_clear_password":
// using clear text password
return cipher, ErrCleartextPassword
} else if plugin == "mysql_native_password" {
case "mysql_native_password":
// using mysql default authentication method
return cipher, ErrNativePassword
} else {
default:
return cipher, ErrUnknownPlugin
}
} else {
// https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::OldAuthSwitchRequest
return nil, ErrOldPassword
}
// https://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::OldAuthSwitchRequest
return nil, ErrOldPassword
default: // Error otherwise
return nil, mc.handleErrorPacket(data)
}
@@ -1187,7 +1188,7 @@ func (rows *binaryRows) readRow(dest []driver.Value) error {
continue
case fieldTypeFloat:
dest[i] = float32(math.Float32frombits(binary.LittleEndian.Uint32(data[pos : pos+4])))
dest[i] = math.Float32frombits(binary.LittleEndian.Uint32(data[pos : pos+4]))
pos += 4
continue

View File

@@ -22,8 +22,9 @@ type mysqlField struct {
}
type resultSet struct {
columns []mysqlField
done bool
columns []mysqlField
columnNames []string
done bool
}
type mysqlRows struct {
@@ -33,12 +34,6 @@ type mysqlRows struct {
type binaryRows struct {
mysqlRows
// stmtCols is a pointer to the statement's cached columns for different
// result sets.
stmtCols *[][]mysqlField
// i is a number of the current result set. It is used to fetch proper
// columns from stmtCols.
i int
}
type textRows struct {
@@ -46,6 +41,10 @@ type textRows struct {
}
func (rows *mysqlRows) Columns() []string {
if rows.rs.columnNames != nil {
return rows.rs.columnNames
}
columns := make([]string, len(rows.rs.columns))
if rows.mc != nil && rows.mc.cfg.ColumnsWithAlias {
for i := range columns {
@@ -60,6 +59,8 @@ func (rows *mysqlRows) Columns() []string {
columns[i] = rows.rs.columns[i].name
}
}
rows.rs.columnNames = columns
return columns
}
@@ -132,25 +133,14 @@ func (rows *mysqlRows) nextNotEmptyResultSet() (int, error) {
}
}
func (rows *binaryRows) NextResultSet() (err error) {
func (rows *binaryRows) NextResultSet() error {
resLen, err := rows.nextNotEmptyResultSet()
if err != nil {
return err
}
// get columns, if not cached, read them and cache them.
if rows.i >= len(*rows.stmtCols) {
rows.rs.columns, err = rows.mc.readColumns(resLen)
*rows.stmtCols = append(*rows.stmtCols, rows.rs.columns)
} else {
rows.rs.columns = (*rows.stmtCols)[rows.i]
if err := rows.mc.readUntilEOF(); err != nil {
return err
}
}
rows.i++
return nil
rows.rs.columns, err = rows.mc.readColumns(resLen)
return err
}
func (rows *binaryRows) Next(dest []driver.Value) error {

View File

@@ -20,7 +20,6 @@ type mysqlStmt struct {
mc *mysqlConn
id uint32
paramCount int
columns [][]mysqlField // cached from the first query
}
func (stmt *mysqlStmt) Close() error {
@@ -109,20 +108,10 @@ func (stmt *mysqlStmt) Query(args []driver.Value) (driver.Rows, error) {
}
rows := new(binaryRows)
rows.stmtCols = &stmt.columns
if resLen > 0 {
rows.mc = mc
rows.i++
// Columns
// If not cached, read them and cache them
if len(stmt.columns) == 0 {
rows.rs.columns, err = mc.readColumns(resLen)
stmt.columns = append(stmt.columns, rows.rs.columns)
} else {
rows.rs.columns = stmt.columns[0]
err = mc.readUntilEOF()
}
rows.rs.columns, err = mc.readColumns(resLen)
} else {
rows.rs.done = true