From 4f4cd5e63573da4d6edcc7d4213afaca67c19f88 Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Mon, 23 Nov 2015 15:53:48 -0800 Subject: upgrading libs --- .../_workspace/src/github.com/go-sql-driver/mysql/utils.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go') diff --git a/Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go b/Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go index 6693d2970..6a26ad129 100644 --- a/Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go +++ b/Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go @@ -80,8 +80,6 @@ func parseDSN(dsn string) (cfg *config, err error) { collation: defaultCollation, } - // TODO: use strings.IndexByte when we can depend on Go 1.2 - // [user[:password]@][net[(addr)]]/dbname[?param1=value1¶mN=valueN] // Find the last '/' (since the password or the net addr might contain a '/') foundSlash := false @@ -201,6 +199,14 @@ func parseDSNParams(cfg *config, params string) (err error) { return fmt.Errorf("Invalid Bool value: %s", value) } + // Use cleartext authentication mode (MySQL 5.5.10+) + case "allowCleartextPasswords": + var isBool bool + cfg.allowCleartextPasswords, isBool = readBool(value) + if !isBool { + return fmt.Errorf("Invalid Bool value: %s", value) + } + // Use old authentication mode (pre MySQL 4.1) case "allowOldPasswords": var isBool bool @@ -771,6 +777,10 @@ func skipLengthEncodedString(b []byte) (int, error) { // returns the number read, whether the value is NULL and the number of bytes read func readLengthEncodedInteger(b []byte) (uint64, bool, int) { + // See issue #349 + if len(b) == 0 { + return 0, true, 1 + } switch b[0] { // 251: NULL -- cgit v1.2.3-1-g7c22