summaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go
diff options
context:
space:
mode:
author=Corey Hulen <corey@hulen.com>2015-11-23 15:53:48 -0800
committer=Corey Hulen <corey@hulen.com>2015-11-23 15:53:48 -0800
commit4f4cd5e63573da4d6edcc7d4213afaca67c19f88 (patch)
treecefbc7af53629d97644ca2f6b2369e9d879f0101 /Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go
parentf8a3c9a14edca6df0647d89cf225f2470cbe025c (diff)
downloadchat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.tar.gz
chat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.tar.bz2
chat-4f4cd5e63573da4d6edcc7d4213afaca67c19f88.zip
upgrading libs
Diffstat (limited to 'Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go')
-rw-r--r--Godeps/_workspace/src/github.com/go-sql-driver/mysql/utils.go14
1 files changed, 12 insertions, 2 deletions
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&paramN=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