Browse Source

upgrade mysql

tags/v2.12.0-rc1
Shivaram Lingamneni 1 year ago
parent
commit
7a82554f9d

+ 1
- 1
go.mod View File

9
 	github.com/ergochat/confusables v0.0.0-20201108231250-4ab98ab61fb1
9
 	github.com/ergochat/confusables v0.0.0-20201108231250-4ab98ab61fb1
10
 	github.com/ergochat/go-ident v0.0.0-20200511222032-830550b1d775
10
 	github.com/ergochat/go-ident v0.0.0-20200511222032-830550b1d775
11
 	github.com/ergochat/irc-go v0.1.0
11
 	github.com/ergochat/irc-go v0.1.0
12
-	github.com/go-sql-driver/mysql v1.6.0
12
+	github.com/go-sql-driver/mysql v1.7.0
13
 	github.com/go-test/deep v1.0.6 // indirect
13
 	github.com/go-test/deep v1.0.6 // indirect
14
 	github.com/golang-jwt/jwt v3.2.2+incompatible
14
 	github.com/golang-jwt/jwt v3.2.2+incompatible
15
 	github.com/gorilla/websocket v1.4.2
15
 	github.com/gorilla/websocket v1.4.2

+ 2
- 0
go.sum View File

21
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
21
 github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
22
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
22
 github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE=
23
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
23
 github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
24
+github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
25
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
24
 github.com/go-test/deep v1.0.6 h1:UHSEyLZUwX9Qoi99vVwvewiMC8mM2bf7XEM2nqvzEn8=
26
 github.com/go-test/deep v1.0.6 h1:UHSEyLZUwX9Qoi99vVwvewiMC8mM2bf7XEM2nqvzEn8=
25
 github.com/go-test/deep v1.0.6/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
27
 github.com/go-test/deep v1.0.6/go.mod h1:QV8Hv/iy04NyLBxAdO9njL0iVPN1S4d/A3NVv1V36o8=
26
 github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=
28
 github.com/gofrs/flock v0.8.1 h1:+gYjHKf32LDeiEEFhQaotPbLuUXjY5ZqxKgXy7n59aw=

+ 7
- 0
vendor/github.com/go-sql-driver/mysql/AUTHORS View File

23
 Bulat Gaifullin <gaifullinbf at gmail.com>
23
 Bulat Gaifullin <gaifullinbf at gmail.com>
24
 Caine Jette <jette at alum.mit.edu>
24
 Caine Jette <jette at alum.mit.edu>
25
 Carlos Nieto <jose.carlos at menteslibres.net>
25
 Carlos Nieto <jose.carlos at menteslibres.net>
26
+Chris Kirkland <chriskirkland at github.com>
26
 Chris Moos <chris at tech9computers.com>
27
 Chris Moos <chris at tech9computers.com>
27
 Craig Wilson <craiggwilson at gmail.com>
28
 Craig Wilson <craiggwilson at gmail.com>
28
 Daniel Montoya <dsmontoyam at gmail.com>
29
 Daniel Montoya <dsmontoyam at gmail.com>
45
 INADA Naoki <songofacandy at gmail.com>
46
 INADA Naoki <songofacandy at gmail.com>
46
 Jacek Szwec <szwec.jacek at gmail.com>
47
 Jacek Szwec <szwec.jacek at gmail.com>
47
 James Harr <james.harr at gmail.com>
48
 James Harr <james.harr at gmail.com>
49
+Janek Vedock <janekvedock at comcast.net>
48
 Jeff Hodges <jeff at somethingsimilar.com>
50
 Jeff Hodges <jeff at somethingsimilar.com>
49
 Jeffrey Charles <jeffreycharles at gmail.com>
51
 Jeffrey Charles <jeffreycharles at gmail.com>
50
 Jerome Meyer <jxmeyer at gmail.com>
52
 Jerome Meyer <jxmeyer at gmail.com>
59
 Kei Kamikawa <x00.x7f.x86 at gmail.com>
61
 Kei Kamikawa <x00.x7f.x86 at gmail.com>
60
 Kevin Malachowski <kevin at chowski.com>
62
 Kevin Malachowski <kevin at chowski.com>
61
 Kieron Woodhouse <kieron.woodhouse at infosum.com>
63
 Kieron Woodhouse <kieron.woodhouse at infosum.com>
64
+Lance Tian <lance6716 at gmail.com>
62
 Lennart Rudolph <lrudolph at hmc.edu>
65
 Lennart Rudolph <lrudolph at hmc.edu>
63
 Leonardo YongUk Kim <dalinaum at gmail.com>
66
 Leonardo YongUk Kim <dalinaum at gmail.com>
64
 Linh Tran Tuan <linhduonggnu at gmail.com>
67
 Linh Tran Tuan <linhduonggnu at gmail.com>
65
 Lion Yang <lion at aosc.xyz>
68
 Lion Yang <lion at aosc.xyz>
66
 Luca Looz <luca.looz92 at gmail.com>
69
 Luca Looz <luca.looz92 at gmail.com>
67
 Lucas Liu <extrafliu at gmail.com>
70
 Lucas Liu <extrafliu at gmail.com>
71
+Lunny Xiao <xiaolunwen at gmail.com>
68
 Luke Scott <luke at webconnex.com>
72
 Luke Scott <luke at webconnex.com>
69
 Maciej Zimnoch <maciej.zimnoch at codilime.com>
73
 Maciej Zimnoch <maciej.zimnoch at codilime.com>
70
 Michael Woolnough <michael.woolnough at gmail.com>
74
 Michael Woolnough <michael.woolnough at gmail.com>
79
 Richard Wilkes <wilkes at me.com>
83
 Richard Wilkes <wilkes at me.com>
80
 Robert Russell <robert at rrbrussell.com>
84
 Robert Russell <robert at rrbrussell.com>
81
 Runrioter Wung <runrioter at gmail.com>
85
 Runrioter Wung <runrioter at gmail.com>
86
+Santhosh Kumar Tekuri <santhosh.tekuri at gmail.com>
82
 Sho Iizuka <sho.i518 at gmail.com>
87
 Sho Iizuka <sho.i518 at gmail.com>
83
 Sho Ikeda <suicaicoca at gmail.com>
88
 Sho Ikeda <suicaicoca at gmail.com>
84
 Shuode Li <elemount at qq.com>
89
 Shuode Li <elemount at qq.com>
99
 Xuehong Chan <chanxuehong at gmail.com>
104
 Xuehong Chan <chanxuehong at gmail.com>
100
 Zhenye Xie <xiezhenye at gmail.com>
105
 Zhenye Xie <xiezhenye at gmail.com>
101
 Zhixin Wen <john.wenzhixin at gmail.com>
106
 Zhixin Wen <john.wenzhixin at gmail.com>
107
+Ziheng Lyu <zihenglv at gmail.com>
102
 
108
 
103
 # Organizations
109
 # Organizations
104
 
110
 
105
 Barracuda Networks, Inc.
111
 Barracuda Networks, Inc.
106
 Counting Ltd.
112
 Counting Ltd.
107
 DigitalOcean Inc.
113
 DigitalOcean Inc.
114
+dyves labs AG
108
 Facebook Inc.
115
 Facebook Inc.
109
 GitHub Inc.
116
 GitHub Inc.
110
 Google Inc.
117
 Google Inc.

+ 21
- 0
vendor/github.com/go-sql-driver/mysql/CHANGELOG.md View File

1
+## Version 1.7 (2022-11-29)
2
+
3
+Changes:
4
+
5
+  - Drop support of Go 1.12 (#1211)
6
+  - Refactoring `(*textRows).readRow` in a more clear way (#1230)
7
+  - util: Reduce boundary check in escape functions. (#1316)
8
+  - enhancement for mysqlConn handleAuthResult (#1250)
9
+
10
+New Features:
11
+
12
+  - support Is comparison on MySQLError (#1210)
13
+  - return unsigned in database type name when necessary (#1238)
14
+  - Add API to express like a --ssl-mode=PREFERRED MySQL client (#1370)
15
+  - Add SQLState to MySQLError (#1321)
16
+
17
+Bugfixes:
18
+
19
+  -  Fix parsing 0 year. (#1257)
20
+
21
+
1
 ## Version 1.6 (2021-04-01)
22
 ## Version 1.6 (2021-04-01)
2
 
23
 
3
 Changes:
24
 Changes:

+ 14
- 3
vendor/github.com/go-sql-driver/mysql/README.md View File

40
   * Optional placeholder interpolation
40
   * Optional placeholder interpolation
41
 
41
 
42
 ## Requirements
42
 ## Requirements
43
-  * Go 1.10 or higher. We aim to support the 3 latest versions of Go.
43
+  * Go 1.13 or higher. We aim to support the 3 latest versions of Go.
44
   * MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+)
44
   * MySQL (4.1+), MariaDB, Percona Server, Google CloudSQL or Sphinx (2.2.3+)
45
 
45
 
46
 ---------------------------------------
46
 ---------------------------------------
85
 
85
 
86
 `db.SetMaxOpenConns()` is highly recommended to limit the number of connection used by the application. There is no recommended limit number because it depends on application and MySQL server.
86
 `db.SetMaxOpenConns()` is highly recommended to limit the number of connection used by the application. There is no recommended limit number because it depends on application and MySQL server.
87
 
87
 
88
-`db.SetMaxIdleConns()` is recommended to be set same to (or greater than) `db.SetMaxOpenConns()`. When it is smaller than `SetMaxOpenConns()`, connections can be opened and closed very frequently than you expect. Idle connections can be closed by the `db.SetConnMaxLifetime()`. If you want to close idle connections more rapidly, you can use `db.SetConnMaxIdleTime()` since Go 1.15.
88
+`db.SetMaxIdleConns()` is recommended to be set same to `db.SetMaxOpenConns()`. When it is smaller than `SetMaxOpenConns()`, connections can be opened and closed much more frequently than you expect. Idle connections can be closed by the `db.SetConnMaxLifetime()`. If you want to close idle connections more rapidly, you can use `db.SetConnMaxIdleTime()` since Go 1.15.
89
 
89
 
90
 
90
 
91
 ### DSN (Data Source Name)
91
 ### DSN (Data Source Name)
157
 
157
 
158
 `allowCleartextPasswords=true` allows using the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
158
 `allowCleartextPasswords=true` allows using the [cleartext client side plugin](https://dev.mysql.com/doc/en/cleartext-pluggable-authentication.html) if required by an account, such as one defined with the [PAM authentication plugin](http://dev.mysql.com/doc/en/pam-authentication-plugin.html). Sending passwords in clear text may be a security problem in some configurations. To avoid problems if there is any possibility that the password would be intercepted, clients should connect to MySQL Server using a method that protects the password. Possibilities include [TLS / SSL](#tls), IPsec, or a private network.
159
 
159
 
160
+
161
+##### `allowFallbackToPlaintext`
162
+
163
+```
164
+Type:           bool
165
+Valid Values:   true, false
166
+Default:        false
167
+```
168
+
169
+`allowFallbackToPlaintext=true` acts like a `--ssl-mode=PREFERRED` MySQL client as described in [Command Options for Connecting to the Server](https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#option_general_ssl-mode)
170
+
160
 ##### `allowNativePasswords`
171
 ##### `allowNativePasswords`
161
 
172
 
162
 ```
173
 ```
454
 The connection pool is managed by Go's database/sql package. For details on how to configure the size of the pool and how long connections stay in the pool see `*DB.SetMaxOpenConns`, `*DB.SetMaxIdleConns`, and `*DB.SetConnMaxLifetime` in the [database/sql documentation](https://golang.org/pkg/database/sql/). The read, write, and dial timeouts for each individual connection are configured with the DSN parameters [`readTimeout`](#readtimeout), [`writeTimeout`](#writetimeout), and [`timeout`](#timeout), respectively.
465
 The connection pool is managed by Go's database/sql package. For details on how to configure the size of the pool and how long connections stay in the pool see `*DB.SetMaxOpenConns`, `*DB.SetMaxIdleConns`, and `*DB.SetConnMaxLifetime` in the [database/sql documentation](https://golang.org/pkg/database/sql/). The read, write, and dial timeouts for each individual connection are configured with the DSN parameters [`readTimeout`](#readtimeout), [`writeTimeout`](#writetimeout), and [`timeout`](#timeout), respectively.
455
 
466
 
456
 ## `ColumnType` Support
467
 ## `ColumnType` Support
457
-This driver supports the [`ColumnType` interface](https://golang.org/pkg/database/sql/#ColumnType) introduced in Go 1.8, with the exception of [`ColumnType.Length()`](https://golang.org/pkg/database/sql/#ColumnType.Length), which is currently not supported.
468
+This driver supports the [`ColumnType` interface](https://golang.org/pkg/database/sql/#ColumnType) introduced in Go 1.8, with the exception of [`ColumnType.Length()`](https://golang.org/pkg/database/sql/#ColumnType.Length), which is currently not supported. All Unsigned database type names will be returned `UNSIGNED ` with `INT`, `TINYINT`, `SMALLINT`, `BIGINT`.
458
 
469
 
459
 ## `context.Context` Support
470
 ## `context.Context` Support
460
 Go 1.8 added `database/sql` support for `context.Context`. This driver supports query timeouts and cancellation via contexts.
471
 Go 1.8 added `database/sql` support for `context.Context`. This driver supports query timeouts and cancellation via contexts.

+ 19
- 0
vendor/github.com/go-sql-driver/mysql/atomic_bool.go View File

1
+// Go MySQL Driver - A MySQL-Driver for Go's database/sql package.
2
+//
3
+// Copyright 2022 The Go-MySQL-Driver Authors. All rights reserved.
4
+//
5
+// This Source Code Form is subject to the terms of the Mozilla Public
6
+// License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
+// You can obtain one at http://mozilla.org/MPL/2.0/.
8
+//go:build go1.19
9
+// +build go1.19
10
+
11
+package mysql
12
+
13
+import "sync/atomic"
14
+
15
+/******************************************************************************
16
+*                               Sync utils                                    *
17
+******************************************************************************/
18
+
19
+type atomicBool = atomic.Bool

+ 47
- 0
vendor/github.com/go-sql-driver/mysql/atomic_bool_go118.go View File

1
+// Go MySQL Driver - A MySQL-Driver for Go's database/sql package.
2
+//
3
+// Copyright 2022 The Go-MySQL-Driver Authors. All rights reserved.
4
+//
5
+// This Source Code Form is subject to the terms of the Mozilla Public
6
+// License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
+// You can obtain one at http://mozilla.org/MPL/2.0/.
8
+//go:build !go1.19
9
+// +build !go1.19
10
+
11
+package mysql
12
+
13
+import "sync/atomic"
14
+
15
+/******************************************************************************
16
+*                               Sync utils                                    *
17
+******************************************************************************/
18
+
19
+// atomicBool is an implementation of atomic.Bool for older version of Go.
20
+// it is a wrapper around uint32 for usage as a boolean value with
21
+// atomic access.
22
+type atomicBool struct {
23
+	_     noCopy
24
+	value uint32
25
+}
26
+
27
+// Load returns whether the current boolean value is true
28
+func (ab *atomicBool) Load() bool {
29
+	return atomic.LoadUint32(&ab.value) > 0
30
+}
31
+
32
+// Store sets the value of the bool regardless of the previous value
33
+func (ab *atomicBool) Store(value bool) {
34
+	if value {
35
+		atomic.StoreUint32(&ab.value, 1)
36
+	} else {
37
+		atomic.StoreUint32(&ab.value, 0)
38
+	}
39
+}
40
+
41
+// Swap sets the value of the bool and returns the old value.
42
+func (ab *atomicBool) Swap(value bool) bool {
43
+	if value {
44
+		return atomic.SwapUint32(&ab.value, 1) > 0
45
+	}
46
+	return atomic.SwapUint32(&ab.value, 0) > 0
47
+}

+ 34
- 22
vendor/github.com/go-sql-driver/mysql/auth.go View File

33
 // Note: The provided rsa.PublicKey instance is exclusively owned by the driver
33
 // Note: The provided rsa.PublicKey instance is exclusively owned by the driver
34
 // after registering it and may not be modified.
34
 // after registering it and may not be modified.
35
 //
35
 //
36
-//  data, err := ioutil.ReadFile("mykey.pem")
37
-//  if err != nil {
38
-//  	log.Fatal(err)
39
-//  }
36
+//	data, err := ioutil.ReadFile("mykey.pem")
37
+//	if err != nil {
38
+//		log.Fatal(err)
39
+//	}
40
 //
40
 //
41
-//  block, _ := pem.Decode(data)
42
-//  if block == nil || block.Type != "PUBLIC KEY" {
43
-//  	log.Fatal("failed to decode PEM block containing public key")
44
-//  }
41
+//	block, _ := pem.Decode(data)
42
+//	if block == nil || block.Type != "PUBLIC KEY" {
43
+//		log.Fatal("failed to decode PEM block containing public key")
44
+//	}
45
 //
45
 //
46
-//  pub, err := x509.ParsePKIXPublicKey(block.Bytes)
47
-//  if err != nil {
48
-//  	log.Fatal(err)
49
-//  }
50
-//
51
-//  if rsaPubKey, ok := pub.(*rsa.PublicKey); ok {
52
-//  	mysql.RegisterServerPubKey("mykey", rsaPubKey)
53
-//  } else {
54
-//  	log.Fatal("not a RSA public key")
55
-//  }
46
+//	pub, err := x509.ParsePKIXPublicKey(block.Bytes)
47
+//	if err != nil {
48
+//		log.Fatal(err)
49
+//	}
56
 //
50
 //
51
+//	if rsaPubKey, ok := pub.(*rsa.PublicKey); ok {
52
+//		mysql.RegisterServerPubKey("mykey", rsaPubKey)
53
+//	} else {
54
+//		log.Fatal("not a RSA public key")
55
+//	}
57
 func RegisterServerPubKey(name string, pubKey *rsa.PublicKey) {
56
 func RegisterServerPubKey(name string, pubKey *rsa.PublicKey) {
58
 	serverPubKeyLock.Lock()
57
 	serverPubKeyLock.Lock()
59
 	if serverPubKeyRegistry == nil {
58
 	if serverPubKeyRegistry == nil {
274
 		if len(mc.cfg.Passwd) == 0 {
273
 		if len(mc.cfg.Passwd) == 0 {
275
 			return []byte{0}, nil
274
 			return []byte{0}, nil
276
 		}
275
 		}
277
-		if mc.cfg.tls != nil || mc.cfg.Net == "unix" {
276
+		// unlike caching_sha2_password, sha256_password does not accept
277
+		// cleartext password on unix transport.
278
+		if mc.cfg.TLS != nil {
278
 			// write cleartext auth packet
279
 			// write cleartext auth packet
279
 			return append([]byte(mc.cfg.Passwd), 0), nil
280
 			return append([]byte(mc.cfg.Passwd), 0), nil
280
 		}
281
 		}
350
 				}
351
 				}
351
 
352
 
352
 			case cachingSha2PasswordPerformFullAuthentication:
353
 			case cachingSha2PasswordPerformFullAuthentication:
353
-				if mc.cfg.tls != nil || mc.cfg.Net == "unix" {
354
+				if mc.cfg.TLS != nil || mc.cfg.Net == "unix" {
354
 					// write cleartext auth packet
355
 					// write cleartext auth packet
355
 					err = mc.writeAuthSwitchPacket(append([]byte(mc.cfg.Passwd), 0))
356
 					err = mc.writeAuthSwitchPacket(append([]byte(mc.cfg.Passwd), 0))
356
 					if err != nil {
357
 					if err != nil {
365
 							return err
366
 							return err
366
 						}
367
 						}
367
 						data[4] = cachingSha2PasswordRequestPublicKey
368
 						data[4] = cachingSha2PasswordRequestPublicKey
368
-						mc.writePacket(data)
369
+						err = mc.writePacket(data)
370
+						if err != nil {
371
+							return err
372
+						}
369
 
373
 
370
-						// parse public key
371
 						if data, err = mc.readPacket(); err != nil {
374
 						if data, err = mc.readPacket(); err != nil {
372
 							return err
375
 							return err
373
 						}
376
 						}
374
 
377
 
378
+						if data[0] != iAuthMoreData {
379
+							return fmt.Errorf("unexpect resp from server for caching_sha2_password perform full authentication")
380
+						}
381
+
382
+						// parse public key
375
 						block, rest := pem.Decode(data[1:])
383
 						block, rest := pem.Decode(data[1:])
376
 						if block == nil {
384
 						if block == nil {
377
 							return fmt.Errorf("No Pem data found, data: %s", rest)
385
 							return fmt.Errorf("No Pem data found, data: %s", rest)
404
 			return nil // auth successful
412
 			return nil // auth successful
405
 		default:
413
 		default:
406
 			block, _ := pem.Decode(authData)
414
 			block, _ := pem.Decode(authData)
415
+			if block == nil {
416
+				return fmt.Errorf("no Pem data found, data: %s", authData)
417
+			}
418
+
407
 			pub, err := x509.ParsePKIXPublicKey(block.Bytes)
419
 			pub, err := x509.ParsePKIXPublicKey(block.Bytes)
408
 			if err != nil {
420
 			if err != nil {
409
 				return err
421
 				return err

+ 2
- 1
vendor/github.com/go-sql-driver/mysql/collations.go View File

13
 
13
 
14
 // A list of available collations mapped to the internal ID.
14
 // A list of available collations mapped to the internal ID.
15
 // To update this map use the following MySQL query:
15
 // To update this map use the following MySQL query:
16
-//     SELECT COLLATION_NAME, ID FROM information_schema.COLLATIONS WHERE ID<256 ORDER BY ID
16
+//
17
+//	SELECT COLLATION_NAME, ID FROM information_schema.COLLATIONS WHERE ID<256 ORDER BY ID
17
 //
18
 //
18
 // Handshake packet have only 1 byte for collation_id.  So we can't use collations with ID > 255.
19
 // Handshake packet have only 1 byte for collation_id.  So we can't use collations with ID > 255.
19
 //
20
 //

+ 1
- 0
vendor/github.com/go-sql-driver/mysql/conncheck.go View File

6
 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
6
 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
 // You can obtain one at http://mozilla.org/MPL/2.0/.
7
 // You can obtain one at http://mozilla.org/MPL/2.0/.
8
 
8
 
9
+//go:build linux || darwin || dragonfly || freebsd || netbsd || openbsd || solaris || illumos
9
 // +build linux darwin dragonfly freebsd netbsd openbsd solaris illumos
10
 // +build linux darwin dragonfly freebsd netbsd openbsd solaris illumos
10
 
11
 
11
 package mysql
12
 package mysql

+ 1
- 0
vendor/github.com/go-sql-driver/mysql/conncheck_dummy.go View File

6
 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
6
 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
 // You can obtain one at http://mozilla.org/MPL/2.0/.
7
 // You can obtain one at http://mozilla.org/MPL/2.0/.
8
 
8
 
9
+//go:build !linux && !darwin && !dragonfly && !freebsd && !netbsd && !openbsd && !solaris && !illumos
9
 // +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos
10
 // +build !linux,!darwin,!dragonfly,!freebsd,!netbsd,!openbsd,!solaris,!illumos
10
 
11
 
11
 package mysql
12
 package mysql

+ 11
- 11
vendor/github.com/go-sql-driver/mysql/connection.go View File

104
 }
104
 }
105
 
105
 
106
 func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
106
 func (mc *mysqlConn) begin(readOnly bool) (driver.Tx, error) {
107
-	if mc.closed.IsSet() {
107
+	if mc.closed.Load() {
108
 		errLog.Print(ErrInvalidConn)
108
 		errLog.Print(ErrInvalidConn)
109
 		return nil, driver.ErrBadConn
109
 		return nil, driver.ErrBadConn
110
 	}
110
 	}
123
 
123
 
124
 func (mc *mysqlConn) Close() (err error) {
124
 func (mc *mysqlConn) Close() (err error) {
125
 	// Makes Close idempotent
125
 	// Makes Close idempotent
126
-	if !mc.closed.IsSet() {
126
+	if !mc.closed.Load() {
127
 		err = mc.writeCommandPacket(comQuit)
127
 		err = mc.writeCommandPacket(comQuit)
128
 	}
128
 	}
129
 
129
 
137
 // is called before auth or on auth failure because MySQL will have already
137
 // is called before auth or on auth failure because MySQL will have already
138
 // closed the network connection.
138
 // closed the network connection.
139
 func (mc *mysqlConn) cleanup() {
139
 func (mc *mysqlConn) cleanup() {
140
-	if !mc.closed.TrySet(true) {
140
+	if mc.closed.Swap(true) {
141
 		return
141
 		return
142
 	}
142
 	}
143
 
143
 
152
 }
152
 }
153
 
153
 
154
 func (mc *mysqlConn) error() error {
154
 func (mc *mysqlConn) error() error {
155
-	if mc.closed.IsSet() {
155
+	if mc.closed.Load() {
156
 		if err := mc.canceled.Value(); err != nil {
156
 		if err := mc.canceled.Value(); err != nil {
157
 			return err
157
 			return err
158
 		}
158
 		}
162
 }
162
 }
163
 
163
 
164
 func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) {
164
 func (mc *mysqlConn) Prepare(query string) (driver.Stmt, error) {
165
-	if mc.closed.IsSet() {
165
+	if mc.closed.Load() {
166
 		errLog.Print(ErrInvalidConn)
166
 		errLog.Print(ErrInvalidConn)
167
 		return nil, driver.ErrBadConn
167
 		return nil, driver.ErrBadConn
168
 	}
168
 	}
295
 }
295
 }
296
 
296
 
297
 func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, error) {
297
 func (mc *mysqlConn) Exec(query string, args []driver.Value) (driver.Result, error) {
298
-	if mc.closed.IsSet() {
298
+	if mc.closed.Load() {
299
 		errLog.Print(ErrInvalidConn)
299
 		errLog.Print(ErrInvalidConn)
300
 		return nil, driver.ErrBadConn
300
 		return nil, driver.ErrBadConn
301
 	}
301
 	}
356
 }
356
 }
357
 
357
 
358
 func (mc *mysqlConn) query(query string, args []driver.Value) (*textRows, error) {
358
 func (mc *mysqlConn) query(query string, args []driver.Value) (*textRows, error) {
359
-	if mc.closed.IsSet() {
359
+	if mc.closed.Load() {
360
 		errLog.Print(ErrInvalidConn)
360
 		errLog.Print(ErrInvalidConn)
361
 		return nil, driver.ErrBadConn
361
 		return nil, driver.ErrBadConn
362
 	}
362
 	}
450
 
450
 
451
 // Ping implements driver.Pinger interface
451
 // Ping implements driver.Pinger interface
452
 func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
452
 func (mc *mysqlConn) Ping(ctx context.Context) (err error) {
453
-	if mc.closed.IsSet() {
453
+	if mc.closed.Load() {
454
 		errLog.Print(ErrInvalidConn)
454
 		errLog.Print(ErrInvalidConn)
455
 		return driver.ErrBadConn
455
 		return driver.ErrBadConn
456
 	}
456
 	}
469
 
469
 
470
 // BeginTx implements driver.ConnBeginTx interface
470
 // BeginTx implements driver.ConnBeginTx interface
471
 func (mc *mysqlConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
471
 func (mc *mysqlConn) BeginTx(ctx context.Context, opts driver.TxOptions) (driver.Tx, error) {
472
-	if mc.closed.IsSet() {
472
+	if mc.closed.Load() {
473
 		return nil, driver.ErrBadConn
473
 		return nil, driver.ErrBadConn
474
 	}
474
 	}
475
 
475
 
636
 // ResetSession implements driver.SessionResetter.
636
 // ResetSession implements driver.SessionResetter.
637
 // (From Go 1.10)
637
 // (From Go 1.10)
638
 func (mc *mysqlConn) ResetSession(ctx context.Context) error {
638
 func (mc *mysqlConn) ResetSession(ctx context.Context) error {
639
-	if mc.closed.IsSet() {
639
+	if mc.closed.Load() {
640
 		return driver.ErrBadConn
640
 		return driver.ErrBadConn
641
 	}
641
 	}
642
 	mc.reset = true
642
 	mc.reset = true
646
 // IsValid implements driver.Validator interface
646
 // IsValid implements driver.Validator interface
647
 // (From Go 1.15)
647
 // (From Go 1.15)
648
 func (mc *mysqlConn) IsValid() bool {
648
 func (mc *mysqlConn) IsValid() bool {
649
-	return !mc.closed.IsSet()
649
+	return !mc.closed.Load()
650
 }
650
 }

+ 3
- 3
vendor/github.com/go-sql-driver/mysql/driver.go View File

8
 //
8
 //
9
 // The driver should be used via the database/sql package:
9
 // The driver should be used via the database/sql package:
10
 //
10
 //
11
-//  import "database/sql"
12
-//  import _ "github.com/go-sql-driver/mysql"
11
+//	import "database/sql"
12
+//	import _ "github.com/go-sql-driver/mysql"
13
 //
13
 //
14
-//  db, err := sql.Open("mysql", "user:password@/dbname")
14
+//	db, err := sql.Open("mysql", "user:password@/dbname")
15
 //
15
 //
16
 // See https://github.com/go-sql-driver/mysql#usage for details
16
 // See https://github.com/go-sql-driver/mysql#usage for details
17
 package mysql
17
 package mysql

+ 45
- 28
vendor/github.com/go-sql-driver/mysql/dsn.go View File

46
 	ServerPubKey     string            // Server public key name
46
 	ServerPubKey     string            // Server public key name
47
 	pubKey           *rsa.PublicKey    // Server public key
47
 	pubKey           *rsa.PublicKey    // Server public key
48
 	TLSConfig        string            // TLS configuration name
48
 	TLSConfig        string            // TLS configuration name
49
-	tls              *tls.Config       // TLS configuration
49
+	TLS              *tls.Config       // TLS configuration, its priority is higher than TLSConfig
50
 	Timeout          time.Duration     // Dial timeout
50
 	Timeout          time.Duration     // Dial timeout
51
 	ReadTimeout      time.Duration     // I/O read timeout
51
 	ReadTimeout      time.Duration     // I/O read timeout
52
 	WriteTimeout     time.Duration     // I/O write timeout
52
 	WriteTimeout     time.Duration     // I/O write timeout
53
 
53
 
54
-	AllowAllFiles           bool // Allow all files to be used with LOAD DATA LOCAL INFILE
55
-	AllowCleartextPasswords bool // Allows the cleartext client side plugin
56
-	AllowNativePasswords    bool // Allows the native password authentication method
57
-	AllowOldPasswords       bool // Allows the old insecure password method
58
-	CheckConnLiveness       bool // Check connections for liveness before using them
59
-	ClientFoundRows         bool // Return number of matching rows instead of rows changed
60
-	ColumnsWithAlias        bool // Prepend table alias to column names
61
-	InterpolateParams       bool // Interpolate placeholders into query string
62
-	MultiStatements         bool // Allow multiple statements in one query
63
-	ParseTime               bool // Parse time values to time.Time
64
-	RejectReadOnly          bool // Reject read-only connections
54
+	AllowAllFiles            bool // Allow all files to be used with LOAD DATA LOCAL INFILE
55
+	AllowCleartextPasswords  bool // Allows the cleartext client side plugin
56
+	AllowFallbackToPlaintext bool // Allows fallback to unencrypted connection if server does not support TLS
57
+	AllowNativePasswords     bool // Allows the native password authentication method
58
+	AllowOldPasswords        bool // Allows the old insecure password method
59
+	CheckConnLiveness        bool // Check connections for liveness before using them
60
+	ClientFoundRows          bool // Return number of matching rows instead of rows changed
61
+	ColumnsWithAlias         bool // Prepend table alias to column names
62
+	InterpolateParams        bool // Interpolate placeholders into query string
63
+	MultiStatements          bool // Allow multiple statements in one query
64
+	ParseTime                bool // Parse time values to time.Time
65
+	RejectReadOnly           bool // Reject read-only connections
65
 }
66
 }
66
 
67
 
67
 // NewConfig creates a new Config and sets default values.
68
 // NewConfig creates a new Config and sets default values.
77
 
78
 
78
 func (cfg *Config) Clone() *Config {
79
 func (cfg *Config) Clone() *Config {
79
 	cp := *cfg
80
 	cp := *cfg
80
-	if cp.tls != nil {
81
-		cp.tls = cfg.tls.Clone()
81
+	if cp.TLS != nil {
82
+		cp.TLS = cfg.TLS.Clone()
82
 	}
83
 	}
83
 	if len(cp.Params) > 0 {
84
 	if len(cp.Params) > 0 {
84
 		cp.Params = make(map[string]string, len(cfg.Params))
85
 		cp.Params = make(map[string]string, len(cfg.Params))
119
 		cfg.Addr = ensureHavePort(cfg.Addr)
120
 		cfg.Addr = ensureHavePort(cfg.Addr)
120
 	}
121
 	}
121
 
122
 
122
-	switch cfg.TLSConfig {
123
-	case "false", "":
124
-		// don't set anything
125
-	case "true":
126
-		cfg.tls = &tls.Config{}
127
-	case "skip-verify", "preferred":
128
-		cfg.tls = &tls.Config{InsecureSkipVerify: true}
129
-	default:
130
-		cfg.tls = getTLSConfigClone(cfg.TLSConfig)
131
-		if cfg.tls == nil {
132
-			return errors.New("invalid value / unknown config name: " + cfg.TLSConfig)
123
+	if cfg.TLS == nil {
124
+		switch cfg.TLSConfig {
125
+		case "false", "":
126
+			// don't set anything
127
+		case "true":
128
+			cfg.TLS = &tls.Config{}
129
+		case "skip-verify":
130
+			cfg.TLS = &tls.Config{InsecureSkipVerify: true}
131
+		case "preferred":
132
+			cfg.TLS = &tls.Config{InsecureSkipVerify: true}
133
+			cfg.AllowFallbackToPlaintext = true
134
+		default:
135
+			cfg.TLS = getTLSConfigClone(cfg.TLSConfig)
136
+			if cfg.TLS == nil {
137
+				return errors.New("invalid value / unknown config name: " + cfg.TLSConfig)
138
+			}
133
 		}
139
 		}
134
 	}
140
 	}
135
 
141
 
136
-	if cfg.tls != nil && cfg.tls.ServerName == "" && !cfg.tls.InsecureSkipVerify {
142
+	if cfg.TLS != nil && cfg.TLS.ServerName == "" && !cfg.TLS.InsecureSkipVerify {
137
 		host, _, err := net.SplitHostPort(cfg.Addr)
143
 		host, _, err := net.SplitHostPort(cfg.Addr)
138
 		if err == nil {
144
 		if err == nil {
139
-			cfg.tls.ServerName = host
145
+			cfg.TLS.ServerName = host
140
 		}
146
 		}
141
 	}
147
 	}
142
 
148
 
204
 		writeDSNParam(&buf, &hasParam, "allowCleartextPasswords", "true")
210
 		writeDSNParam(&buf, &hasParam, "allowCleartextPasswords", "true")
205
 	}
211
 	}
206
 
212
 
213
+	if cfg.AllowFallbackToPlaintext {
214
+		writeDSNParam(&buf, &hasParam, "allowFallbackToPlaintext", "true")
215
+	}
216
+
207
 	if !cfg.AllowNativePasswords {
217
 	if !cfg.AllowNativePasswords {
208
 		writeDSNParam(&buf, &hasParam, "allowNativePasswords", "false")
218
 		writeDSNParam(&buf, &hasParam, "allowNativePasswords", "false")
209
 	}
219
 	}
391
 				return errors.New("invalid bool value: " + value)
401
 				return errors.New("invalid bool value: " + value)
392
 			}
402
 			}
393
 
403
 
404
+		// Allow fallback to unencrypted connection if server does not support TLS
405
+		case "allowFallbackToPlaintext":
406
+			var isBool bool
407
+			cfg.AllowFallbackToPlaintext, isBool = readBool(value)
408
+			if !isBool {
409
+				return errors.New("invalid bool value: " + value)
410
+			}
411
+
394
 		// Use native password authentication
412
 		// Use native password authentication
395
 		case "allowNativePasswords":
413
 		case "allowNativePasswords":
396
 			var isBool bool
414
 			var isBool bool
426
 		// Collation
444
 		// Collation
427
 		case "collation":
445
 		case "collation":
428
 			cfg.Collation = value
446
 			cfg.Collation = value
429
-			break
430
 
447
 
431
 		case "columnsWithAlias":
448
 		case "columnsWithAlias":
432
 			var isBool bool
449
 			var isBool bool

+ 14
- 2
vendor/github.com/go-sql-driver/mysql/errors.go View File

56
 
56
 
57
 // MySQLError is an error type which represents a single MySQL error
57
 // MySQLError is an error type which represents a single MySQL error
58
 type MySQLError struct {
58
 type MySQLError struct {
59
-	Number  uint16
60
-	Message string
59
+	Number   uint16
60
+	SQLState [5]byte
61
+	Message  string
61
 }
62
 }
62
 
63
 
63
 func (me *MySQLError) Error() string {
64
 func (me *MySQLError) Error() string {
65
+	if me.SQLState != [5]byte{} {
66
+		return fmt.Sprintf("Error %d (%s): %s", me.Number, me.SQLState, me.Message)
67
+	}
68
+
64
 	return fmt.Sprintf("Error %d: %s", me.Number, me.Message)
69
 	return fmt.Sprintf("Error %d: %s", me.Number, me.Message)
65
 }
70
 }
71
+
72
+func (me *MySQLError) Is(err error) bool {
73
+	if merr, ok := err.(*MySQLError); ok {
74
+		return merr.Number == me.Number
75
+	}
76
+	return false
77
+}

+ 13
- 1
vendor/github.com/go-sql-driver/mysql/fields.go View File

41
 	case fieldTypeJSON:
41
 	case fieldTypeJSON:
42
 		return "JSON"
42
 		return "JSON"
43
 	case fieldTypeLong:
43
 	case fieldTypeLong:
44
+		if mf.flags&flagUnsigned != 0 {
45
+			return "UNSIGNED INT"
46
+		}
44
 		return "INT"
47
 		return "INT"
45
 	case fieldTypeLongBLOB:
48
 	case fieldTypeLongBLOB:
46
 		if mf.charSet != collations[binaryCollation] {
49
 		if mf.charSet != collations[binaryCollation] {
48
 		}
51
 		}
49
 		return "LONGBLOB"
52
 		return "LONGBLOB"
50
 	case fieldTypeLongLong:
53
 	case fieldTypeLongLong:
54
+		if mf.flags&flagUnsigned != 0 {
55
+			return "UNSIGNED BIGINT"
56
+		}
51
 		return "BIGINT"
57
 		return "BIGINT"
52
 	case fieldTypeMediumBLOB:
58
 	case fieldTypeMediumBLOB:
53
 		if mf.charSet != collations[binaryCollation] {
59
 		if mf.charSet != collations[binaryCollation] {
63
 	case fieldTypeSet:
69
 	case fieldTypeSet:
64
 		return "SET"
70
 		return "SET"
65
 	case fieldTypeShort:
71
 	case fieldTypeShort:
72
+		if mf.flags&flagUnsigned != 0 {
73
+			return "UNSIGNED SMALLINT"
74
+		}
66
 		return "SMALLINT"
75
 		return "SMALLINT"
67
 	case fieldTypeString:
76
 	case fieldTypeString:
68
 		if mf.charSet == collations[binaryCollation] {
77
 		if mf.charSet == collations[binaryCollation] {
74
 	case fieldTypeTimestamp:
83
 	case fieldTypeTimestamp:
75
 		return "TIMESTAMP"
84
 		return "TIMESTAMP"
76
 	case fieldTypeTiny:
85
 	case fieldTypeTiny:
86
+		if mf.flags&flagUnsigned != 0 {
87
+			return "UNSIGNED TINYINT"
88
+		}
77
 		return "TINYINT"
89
 		return "TINYINT"
78
 	case fieldTypeTinyBLOB:
90
 	case fieldTypeTinyBLOB:
79
 		if mf.charSet != collations[binaryCollation] {
91
 		if mf.charSet != collations[binaryCollation] {
106
 	scanTypeInt64     = reflect.TypeOf(int64(0))
118
 	scanTypeInt64     = reflect.TypeOf(int64(0))
107
 	scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{})
119
 	scanTypeNullFloat = reflect.TypeOf(sql.NullFloat64{})
108
 	scanTypeNullInt   = reflect.TypeOf(sql.NullInt64{})
120
 	scanTypeNullInt   = reflect.TypeOf(sql.NullInt64{})
109
-	scanTypeNullTime  = reflect.TypeOf(nullTime{})
121
+	scanTypeNullTime  = reflect.TypeOf(sql.NullTime{})
110
 	scanTypeUint8     = reflect.TypeOf(uint8(0))
122
 	scanTypeUint8     = reflect.TypeOf(uint8(0))
111
 	scanTypeUint16    = reflect.TypeOf(uint16(0))
123
 	scanTypeUint16    = reflect.TypeOf(uint16(0))
112
 	scanTypeUint32    = reflect.TypeOf(uint32(0))
124
 	scanTypeUint32    = reflect.TypeOf(uint32(0))

+ 1
- 0
vendor/github.com/go-sql-driver/mysql/fuzz.go View File

6
 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
6
 // License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
 // You can obtain one at http://mozilla.org/MPL/2.0/.
7
 // You can obtain one at http://mozilla.org/MPL/2.0/.
8
 
8
 
9
+//go:build gofuzz
9
 // +build gofuzz
10
 // +build gofuzz
10
 
11
 
11
 package mysql
12
 package mysql

+ 16
- 16
vendor/github.com/go-sql-driver/mysql/infile.go View File

28
 // Alternatively you can allow the use of all local files with
28
 // Alternatively you can allow the use of all local files with
29
 // the DSN parameter 'allowAllFiles=true'
29
 // the DSN parameter 'allowAllFiles=true'
30
 //
30
 //
31
-//  filePath := "/home/gopher/data.csv"
32
-//  mysql.RegisterLocalFile(filePath)
33
-//  err := db.Exec("LOAD DATA LOCAL INFILE '" + filePath + "' INTO TABLE foo")
34
-//  if err != nil {
35
-//  ...
36
-//
31
+//	filePath := "/home/gopher/data.csv"
32
+//	mysql.RegisterLocalFile(filePath)
33
+//	err := db.Exec("LOAD DATA LOCAL INFILE '" + filePath + "' INTO TABLE foo")
34
+//	if err != nil {
35
+//	...
37
 func RegisterLocalFile(filePath string) {
36
 func RegisterLocalFile(filePath string) {
38
 	fileRegisterLock.Lock()
37
 	fileRegisterLock.Lock()
39
 	// lazy map init
38
 	// lazy map init
58
 // If the handler returns a io.ReadCloser Close() is called when the
57
 // If the handler returns a io.ReadCloser Close() is called when the
59
 // request is finished.
58
 // request is finished.
60
 //
59
 //
61
-//  mysql.RegisterReaderHandler("data", func() io.Reader {
62
-//  	var csvReader io.Reader // Some Reader that returns CSV data
63
-//  	... // Open Reader here
64
-//  	return csvReader
65
-//  })
66
-//  err := db.Exec("LOAD DATA LOCAL INFILE 'Reader::data' INTO TABLE foo")
67
-//  if err != nil {
68
-//  ...
69
-//
60
+//	mysql.RegisterReaderHandler("data", func() io.Reader {
61
+//		var csvReader io.Reader // Some Reader that returns CSV data
62
+//		... // Open Reader here
63
+//		return csvReader
64
+//	})
65
+//	err := db.Exec("LOAD DATA LOCAL INFILE 'Reader::data' INTO TABLE foo")
66
+//	if err != nil {
67
+//	...
70
 func RegisterReaderHandler(name string, handler func() io.Reader) {
68
 func RegisterReaderHandler(name string, handler func() io.Reader) {
71
 	readerRegisterLock.Lock()
69
 	readerRegisterLock.Lock()
72
 	// lazy map init
70
 	// lazy map init
93
 	}
91
 	}
94
 }
92
 }
95
 
93
 
94
+const defaultPacketSize = 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP
95
+
96
 func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
96
 func (mc *mysqlConn) handleInFileRequest(name string) (err error) {
97
 	var rdr io.Reader
97
 	var rdr io.Reader
98
 	var data []byte
98
 	var data []byte
99
-	packetSize := 16 * 1024 // 16KB is small enough for disk readahead and large enough for TCP
99
+	packetSize := defaultPacketSize
100
 	if mc.maxWriteSize < packetSize {
100
 	if mc.maxWriteSize < packetSize {
101
 		packetSize = mc.maxWriteSize
101
 		packetSize = mc.maxWriteSize
102
 	}
102
 	}

+ 21
- 0
vendor/github.com/go-sql-driver/mysql/nulltime.go View File

9
 package mysql
9
 package mysql
10
 
10
 
11
 import (
11
 import (
12
+	"database/sql"
12
 	"database/sql/driver"
13
 	"database/sql/driver"
13
 	"fmt"
14
 	"fmt"
14
 	"time"
15
 	"time"
15
 )
16
 )
16
 
17
 
18
+// NullTime represents a time.Time that may be NULL.
19
+// NullTime implements the Scanner interface so
20
+// it can be used as a scan destination:
21
+//
22
+//	var nt NullTime
23
+//	err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
24
+//	...
25
+//	if nt.Valid {
26
+//	   // use nt.Time
27
+//	} else {
28
+//	   // NULL value
29
+//	}
30
+//
31
+// # This NullTime implementation is not driver-specific
32
+//
33
+// Deprecated: NullTime doesn't honor the loc DSN parameter.
34
+// NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
35
+// Use sql.NullTime instead.
36
+type NullTime sql.NullTime
37
+
17
 // Scan implements the Scanner interface.
38
 // Scan implements the Scanner interface.
18
 // The value type must be time.Time or string / []byte (formatted time-string),
39
 // The value type must be time.Time or string / []byte (formatted time-string),
19
 // otherwise Scan fails.
40
 // otherwise Scan fails.

+ 0
- 40
vendor/github.com/go-sql-driver/mysql/nulltime_go113.go View File

1
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2
-//
3
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
4
-//
5
-// This Source Code Form is subject to the terms of the Mozilla Public
6
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
-// You can obtain one at http://mozilla.org/MPL/2.0/.
8
-
9
-// +build go1.13
10
-
11
-package mysql
12
-
13
-import (
14
-	"database/sql"
15
-)
16
-
17
-// NullTime represents a time.Time that may be NULL.
18
-// NullTime implements the Scanner interface so
19
-// it can be used as a scan destination:
20
-//
21
-//  var nt NullTime
22
-//  err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
23
-//  ...
24
-//  if nt.Valid {
25
-//     // use nt.Time
26
-//  } else {
27
-//     // NULL value
28
-//  }
29
-//
30
-// This NullTime implementation is not driver-specific
31
-//
32
-// Deprecated: NullTime doesn't honor the loc DSN parameter.
33
-// NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
34
-// Use sql.NullTime instead.
35
-type NullTime sql.NullTime
36
-
37
-// for internal use.
38
-// the mysql package uses sql.NullTime if it is available.
39
-// if not, the package uses mysql.NullTime.
40
-type nullTime = sql.NullTime // sql.NullTime is available

+ 0
- 39
vendor/github.com/go-sql-driver/mysql/nulltime_legacy.go View File

1
-// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
2
-//
3
-// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
4
-//
5
-// This Source Code Form is subject to the terms of the Mozilla Public
6
-// License, v. 2.0. If a copy of the MPL was not distributed with this file,
7
-// You can obtain one at http://mozilla.org/MPL/2.0/.
8
-
9
-// +build !go1.13
10
-
11
-package mysql
12
-
13
-import (
14
-	"time"
15
-)
16
-
17
-// NullTime represents a time.Time that may be NULL.
18
-// NullTime implements the Scanner interface so
19
-// it can be used as a scan destination:
20
-//
21
-//  var nt NullTime
22
-//  err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
23
-//  ...
24
-//  if nt.Valid {
25
-//     // use nt.Time
26
-//  } else {
27
-//     // NULL value
28
-//  }
29
-//
30
-// This NullTime implementation is not driver-specific
31
-type NullTime struct {
32
-	Time  time.Time
33
-	Valid bool // Valid is true if Time is not NULL
34
-}
35
-
36
-// for internal use.
37
-// the mysql package uses sql.NullTime if it is available.
38
-// if not, the package uses mysql.NullTime.
39
-type nullTime = NullTime // sql.NullTime is not available

+ 45
- 45
vendor/github.com/go-sql-driver/mysql/packets.go View File

110
 			conn = mc.rawConn
110
 			conn = mc.rawConn
111
 		}
111
 		}
112
 		var err error
112
 		var err error
113
-		// If this connection has a ReadTimeout which we've been setting on
114
-		// reads, reset it to its default value before we attempt a non-blocking
115
-		// read, otherwise the scheduler will just time us out before we can read
116
-		if mc.cfg.ReadTimeout != 0 {
117
-			err = conn.SetReadDeadline(time.Time{})
118
-		}
119
-		if err == nil && mc.cfg.CheckConnLiveness {
120
-			err = connCheck(conn)
113
+		if mc.cfg.CheckConnLiveness {
114
+			if mc.cfg.ReadTimeout != 0 {
115
+				err = conn.SetReadDeadline(time.Now().Add(mc.cfg.ReadTimeout))
116
+			}
117
+			if err == nil {
118
+				err = connCheck(conn)
119
+			}
121
 		}
120
 		}
122
 		if err != nil {
121
 		if err != nil {
123
 			errLog.Print("closing bad idle connection: ", err)
122
 			errLog.Print("closing bad idle connection: ", err)
223
 	if mc.flags&clientProtocol41 == 0 {
222
 	if mc.flags&clientProtocol41 == 0 {
224
 		return nil, "", ErrOldProtocol
223
 		return nil, "", ErrOldProtocol
225
 	}
224
 	}
226
-	if mc.flags&clientSSL == 0 && mc.cfg.tls != nil {
227
-		if mc.cfg.TLSConfig == "preferred" {
228
-			mc.cfg.tls = nil
225
+	if mc.flags&clientSSL == 0 && mc.cfg.TLS != nil {
226
+		if mc.cfg.AllowFallbackToPlaintext {
227
+			mc.cfg.TLS = nil
229
 		} else {
228
 		} else {
230
 			return nil, "", ErrNoTLS
229
 			return nil, "", ErrNoTLS
231
 		}
230
 		}
293
 	}
292
 	}
294
 
293
 
295
 	// To enable TLS / SSL
294
 	// To enable TLS / SSL
296
-	if mc.cfg.tls != nil {
295
+	if mc.cfg.TLS != nil {
297
 		clientFlags |= clientSSL
296
 		clientFlags |= clientSSL
298
 	}
297
 	}
299
 
298
 
357
 
356
 
358
 	// SSL Connection Request Packet
357
 	// SSL Connection Request Packet
359
 	// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
358
 	// http://dev.mysql.com/doc/internals/en/connection-phase-packets.html#packet-Protocol::SSLRequest
360
-	if mc.cfg.tls != nil {
359
+	if mc.cfg.TLS != nil {
361
 		// Send TLS / SSL request packet
360
 		// Send TLS / SSL request packet
362
 		if err := mc.writePacket(data[:(4+4+1+23)+4]); err != nil {
361
 		if err := mc.writePacket(data[:(4+4+1+23)+4]); err != nil {
363
 			return err
362
 			return err
364
 		}
363
 		}
365
 
364
 
366
 		// Switch to TLS
365
 		// Switch to TLS
367
-		tlsConn := tls.Client(mc.netConn, mc.cfg.tls)
366
+		tlsConn := tls.Client(mc.netConn, mc.cfg.TLS)
368
 		if err := tlsConn.Handshake(); err != nil {
367
 		if err := tlsConn.Handshake(); err != nil {
369
 			return err
368
 			return err
370
 		}
369
 		}
588
 		return driver.ErrBadConn
587
 		return driver.ErrBadConn
589
 	}
588
 	}
590
 
589
 
590
+	me := &MySQLError{Number: errno}
591
+
591
 	pos := 3
592
 	pos := 3
592
 
593
 
593
 	// SQL State [optional: # + 5bytes string]
594
 	// SQL State [optional: # + 5bytes string]
594
 	if data[3] == 0x23 {
595
 	if data[3] == 0x23 {
595
-		//sqlstate := string(data[4 : 4+5])
596
+		copy(me.SQLState[:], data[4:4+5])
596
 		pos = 9
597
 		pos = 9
597
 	}
598
 	}
598
 
599
 
599
 	// Error Message [string]
600
 	// Error Message [string]
600
-	return &MySQLError{
601
-		Number:  errno,
602
-		Message: string(data[pos:]),
603
-	}
601
+	me.Message = string(data[pos:])
602
+
603
+	return me
604
 }
604
 }
605
 
605
 
606
 func readStatus(b []byte) statusFlag {
606
 func readStatus(b []byte) statusFlag {
761
 	}
761
 	}
762
 
762
 
763
 	// RowSet Packet
763
 	// RowSet Packet
764
-	var n int
765
-	var isNull bool
766
-	pos := 0
764
+	var (
765
+		n      int
766
+		isNull bool
767
+		pos    int = 0
768
+	)
767
 
769
 
768
 	for i := range dest {
770
 	for i := range dest {
769
 		// Read bytes and convert to string
771
 		// Read bytes and convert to string
770
 		dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
772
 		dest[i], isNull, n, err = readLengthEncodedString(data[pos:])
771
 		pos += n
773
 		pos += n
772
-		if err == nil {
773
-			if !isNull {
774
-				if !mc.parseTime {
775
-					continue
776
-				} else {
777
-					switch rows.rs.columns[i].fieldType {
778
-					case fieldTypeTimestamp, fieldTypeDateTime,
779
-						fieldTypeDate, fieldTypeNewDate:
780
-						dest[i], err = parseDateTime(
781
-							dest[i].([]byte),
782
-							mc.cfg.Loc,
783
-						)
784
-						if err == nil {
785
-							continue
786
-						}
787
-					default:
788
-						continue
789
-					}
790
-				}
791
 
774
 
792
-			} else {
793
-				dest[i] = nil
794
-				continue
775
+		if err != nil {
776
+			return err
777
+		}
778
+
779
+		if isNull {
780
+			dest[i] = nil
781
+			continue
782
+		}
783
+
784
+		if !mc.parseTime {
785
+			continue
786
+		}
787
+
788
+		// Parse time field
789
+		switch rows.rs.columns[i].fieldType {
790
+		case fieldTypeTimestamp,
791
+			fieldTypeDateTime,
792
+			fieldTypeDate,
793
+			fieldTypeNewDate:
794
+			if dest[i], err = parseDateTime(dest[i].([]byte), mc.cfg.Loc); err != nil {
795
+				return err
795
 			}
796
 			}
796
 		}
797
 		}
797
-		return err // err != nil
798
 	}
798
 	}
799
 
799
 
800
 	return nil
800
 	return nil

+ 4
- 4
vendor/github.com/go-sql-driver/mysql/statement.go View File

23
 }
23
 }
24
 
24
 
25
 func (stmt *mysqlStmt) Close() error {
25
 func (stmt *mysqlStmt) Close() error {
26
-	if stmt.mc == nil || stmt.mc.closed.IsSet() {
26
+	if stmt.mc == nil || stmt.mc.closed.Load() {
27
 		// driver.Stmt.Close can be called more than once, thus this function
27
 		// driver.Stmt.Close can be called more than once, thus this function
28
 		// has to be idempotent.
28
 		// has to be idempotent.
29
 		// See also Issue #450 and golang/go#16019.
29
 		// See also Issue #450 and golang/go#16019.
50
 }
50
 }
51
 
51
 
52
 func (stmt *mysqlStmt) Exec(args []driver.Value) (driver.Result, error) {
52
 func (stmt *mysqlStmt) Exec(args []driver.Value) (driver.Result, error) {
53
-	if stmt.mc.closed.IsSet() {
53
+	if stmt.mc.closed.Load() {
54
 		errLog.Print(ErrInvalidConn)
54
 		errLog.Print(ErrInvalidConn)
55
 		return nil, driver.ErrBadConn
55
 		return nil, driver.ErrBadConn
56
 	}
56
 	}
98
 }
98
 }
99
 
99
 
100
 func (stmt *mysqlStmt) query(args []driver.Value) (*binaryRows, error) {
100
 func (stmt *mysqlStmt) query(args []driver.Value) (*binaryRows, error) {
101
-	if stmt.mc.closed.IsSet() {
101
+	if stmt.mc.closed.Load() {
102
 		errLog.Print(ErrInvalidConn)
102
 		errLog.Print(ErrInvalidConn)
103
 		return nil, driver.ErrBadConn
103
 		return nil, driver.ErrBadConn
104
 	}
104
 	}
157
 		if driver.IsValue(sv) {
157
 		if driver.IsValue(sv) {
158
 			return sv, nil
158
 			return sv, nil
159
 		}
159
 		}
160
-		// A value returend from the Valuer interface can be "a type handled by
160
+		// A value returned from the Valuer interface can be "a type handled by
161
 		// a database driver's NamedValueChecker interface" so we should accept
161
 		// a database driver's NamedValueChecker interface" so we should accept
162
 		// uint64 here as well.
162
 		// uint64 here as well.
163
 		if u, ok := sv.(uint64); ok {
163
 		if u, ok := sv.(uint64); ok {

+ 2
- 2
vendor/github.com/go-sql-driver/mysql/transaction.go View File

13
 }
13
 }
14
 
14
 
15
 func (tx *mysqlTx) Commit() (err error) {
15
 func (tx *mysqlTx) Commit() (err error) {
16
-	if tx.mc == nil || tx.mc.closed.IsSet() {
16
+	if tx.mc == nil || tx.mc.closed.Load() {
17
 		return ErrInvalidConn
17
 		return ErrInvalidConn
18
 	}
18
 	}
19
 	err = tx.mc.exec("COMMIT")
19
 	err = tx.mc.exec("COMMIT")
22
 }
22
 }
23
 
23
 
24
 func (tx *mysqlTx) Rollback() (err error) {
24
 func (tx *mysqlTx) Rollback() (err error) {
25
-	if tx.mc == nil || tx.mc.closed.IsSet() {
25
+	if tx.mc == nil || tx.mc.closed.Load() {
26
 		return ErrInvalidConn
26
 		return ErrInvalidConn
27
 	}
27
 	}
28
 	err = tx.mc.exec("ROLLBACK")
28
 	err = tx.mc.exec("ROLLBACK")

+ 44
- 78
vendor/github.com/go-sql-driver/mysql/utils.go View File

35
 // Note: The provided tls.Config is exclusively owned by the driver after
35
 // Note: The provided tls.Config is exclusively owned by the driver after
36
 // registering it.
36
 // registering it.
37
 //
37
 //
38
-//  rootCertPool := x509.NewCertPool()
39
-//  pem, err := ioutil.ReadFile("/path/ca-cert.pem")
40
-//  if err != nil {
41
-//      log.Fatal(err)
42
-//  }
43
-//  if ok := rootCertPool.AppendCertsFromPEM(pem); !ok {
44
-//      log.Fatal("Failed to append PEM.")
45
-//  }
46
-//  clientCert := make([]tls.Certificate, 0, 1)
47
-//  certs, err := tls.LoadX509KeyPair("/path/client-cert.pem", "/path/client-key.pem")
48
-//  if err != nil {
49
-//      log.Fatal(err)
50
-//  }
51
-//  clientCert = append(clientCert, certs)
52
-//  mysql.RegisterTLSConfig("custom", &tls.Config{
53
-//      RootCAs: rootCertPool,
54
-//      Certificates: clientCert,
55
-//  })
56
-//  db, err := sql.Open("mysql", "user@tcp(localhost:3306)/test?tls=custom")
57
-//
38
+//	rootCertPool := x509.NewCertPool()
39
+//	pem, err := ioutil.ReadFile("/path/ca-cert.pem")
40
+//	if err != nil {
41
+//	    log.Fatal(err)
42
+//	}
43
+//	if ok := rootCertPool.AppendCertsFromPEM(pem); !ok {
44
+//	    log.Fatal("Failed to append PEM.")
45
+//	}
46
+//	clientCert := make([]tls.Certificate, 0, 1)
47
+//	certs, err := tls.LoadX509KeyPair("/path/client-cert.pem", "/path/client-key.pem")
48
+//	if err != nil {
49
+//	    log.Fatal(err)
50
+//	}
51
+//	clientCert = append(clientCert, certs)
52
+//	mysql.RegisterTLSConfig("custom", &tls.Config{
53
+//	    RootCAs: rootCertPool,
54
+//	    Certificates: clientCert,
55
+//	})
56
+//	db, err := sql.Open("mysql", "user@tcp(localhost:3306)/test?tls=custom")
58
 func RegisterTLSConfig(key string, config *tls.Config) error {
57
 func RegisterTLSConfig(key string, config *tls.Config) error {
59
 	if _, isBool := readBool(key); isBool || strings.ToLower(key) == "skip-verify" || strings.ToLower(key) == "preferred" {
58
 	if _, isBool := readBool(key); isBool || strings.ToLower(key) == "skip-verify" || strings.ToLower(key) == "preferred" {
60
 		return fmt.Errorf("key '%s' is reserved", key)
59
 		return fmt.Errorf("key '%s' is reserved", key)
118
 		if err != nil {
117
 		if err != nil {
119
 			return time.Time{}, err
118
 			return time.Time{}, err
120
 		}
119
 		}
121
-		if year <= 0 {
122
-			year = 1
123
-		}
124
-
125
 		if b[4] != '-' {
120
 		if b[4] != '-' {
126
 			return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[4])
121
 			return time.Time{}, fmt.Errorf("bad value for field: `%c`", b[4])
127
 		}
122
 		}
130
 		if err != nil {
125
 		if err != nil {
131
 			return time.Time{}, err
126
 			return time.Time{}, err
132
 		}
127
 		}
133
-		if m <= 0 {
134
-			m = 1
135
-		}
136
 		month := time.Month(m)
128
 		month := time.Month(m)
137
 
129
 
138
 		if b[7] != '-' {
130
 		if b[7] != '-' {
143
 		if err != nil {
135
 		if err != nil {
144
 			return time.Time{}, err
136
 			return time.Time{}, err
145
 		}
137
 		}
146
-		if day <= 0 {
147
-			day = 1
148
-		}
149
 		if len(b) == 10 {
138
 		if len(b) == 10 {
150
 			return time.Date(year, month, day, 0, 0, 0, 0, loc), nil
139
 			return time.Date(year, month, day, 0, 0, 0, 0, loc), nil
151
 		}
140
 		}
199
 			return 0, err
188
 			return 0, err
200
 		}
189
 		}
201
 		year += v * n
190
 		year += v * n
202
-		n = n / 10
191
+		n /= 10
203
 	}
192
 	}
204
 	return year, nil
193
 	return year, nil
205
 }
194
 }
542
 	return val
531
 	return val
543
 }
532
 }
544
 
533
 
545
-// returns the string read as a bytes slice, wheter the value is NULL,
534
+// returns the string read as a bytes slice, whether the value is NULL,
546
 // the number of bytes read and an error, in case the string is longer than
535
 // the number of bytes read and an error, in case the string is longer than
547
 // the input slice
536
 // the input slice
548
 func readLengthEncodedString(b []byte) ([]byte, bool, int, error) {
537
 func readLengthEncodedString(b []byte) ([]byte, bool, int, error) {
652
 	for _, c := range v {
641
 	for _, c := range v {
653
 		switch c {
642
 		switch c {
654
 		case '\x00':
643
 		case '\x00':
655
-			buf[pos] = '\\'
656
 			buf[pos+1] = '0'
644
 			buf[pos+1] = '0'
645
+			buf[pos] = '\\'
657
 			pos += 2
646
 			pos += 2
658
 		case '\n':
647
 		case '\n':
659
-			buf[pos] = '\\'
660
 			buf[pos+1] = 'n'
648
 			buf[pos+1] = 'n'
649
+			buf[pos] = '\\'
661
 			pos += 2
650
 			pos += 2
662
 		case '\r':
651
 		case '\r':
663
-			buf[pos] = '\\'
664
 			buf[pos+1] = 'r'
652
 			buf[pos+1] = 'r'
653
+			buf[pos] = '\\'
665
 			pos += 2
654
 			pos += 2
666
 		case '\x1a':
655
 		case '\x1a':
667
-			buf[pos] = '\\'
668
 			buf[pos+1] = 'Z'
656
 			buf[pos+1] = 'Z'
657
+			buf[pos] = '\\'
669
 			pos += 2
658
 			pos += 2
670
 		case '\'':
659
 		case '\'':
671
-			buf[pos] = '\\'
672
 			buf[pos+1] = '\''
660
 			buf[pos+1] = '\''
661
+			buf[pos] = '\\'
673
 			pos += 2
662
 			pos += 2
674
 		case '"':
663
 		case '"':
675
-			buf[pos] = '\\'
676
 			buf[pos+1] = '"'
664
 			buf[pos+1] = '"'
665
+			buf[pos] = '\\'
677
 			pos += 2
666
 			pos += 2
678
 		case '\\':
667
 		case '\\':
679
-			buf[pos] = '\\'
680
 			buf[pos+1] = '\\'
668
 			buf[pos+1] = '\\'
669
+			buf[pos] = '\\'
681
 			pos += 2
670
 			pos += 2
682
 		default:
671
 		default:
683
 			buf[pos] = c
672
 			buf[pos] = c
697
 		c := v[i]
686
 		c := v[i]
698
 		switch c {
687
 		switch c {
699
 		case '\x00':
688
 		case '\x00':
700
-			buf[pos] = '\\'
701
 			buf[pos+1] = '0'
689
 			buf[pos+1] = '0'
690
+			buf[pos] = '\\'
702
 			pos += 2
691
 			pos += 2
703
 		case '\n':
692
 		case '\n':
704
-			buf[pos] = '\\'
705
 			buf[pos+1] = 'n'
693
 			buf[pos+1] = 'n'
694
+			buf[pos] = '\\'
706
 			pos += 2
695
 			pos += 2
707
 		case '\r':
696
 		case '\r':
708
-			buf[pos] = '\\'
709
 			buf[pos+1] = 'r'
697
 			buf[pos+1] = 'r'
698
+			buf[pos] = '\\'
710
 			pos += 2
699
 			pos += 2
711
 		case '\x1a':
700
 		case '\x1a':
712
-			buf[pos] = '\\'
713
 			buf[pos+1] = 'Z'
701
 			buf[pos+1] = 'Z'
702
+			buf[pos] = '\\'
714
 			pos += 2
703
 			pos += 2
715
 		case '\'':
704
 		case '\'':
716
-			buf[pos] = '\\'
717
 			buf[pos+1] = '\''
705
 			buf[pos+1] = '\''
706
+			buf[pos] = '\\'
718
 			pos += 2
707
 			pos += 2
719
 		case '"':
708
 		case '"':
720
-			buf[pos] = '\\'
721
 			buf[pos+1] = '"'
709
 			buf[pos+1] = '"'
710
+			buf[pos] = '\\'
722
 			pos += 2
711
 			pos += 2
723
 		case '\\':
712
 		case '\\':
724
-			buf[pos] = '\\'
725
 			buf[pos+1] = '\\'
713
 			buf[pos+1] = '\\'
714
+			buf[pos] = '\\'
726
 			pos += 2
715
 			pos += 2
727
 		default:
716
 		default:
728
 			buf[pos] = c
717
 			buf[pos] = c
744
 
733
 
745
 	for _, c := range v {
734
 	for _, c := range v {
746
 		if c == '\'' {
735
 		if c == '\'' {
747
-			buf[pos] = '\''
748
 			buf[pos+1] = '\''
736
 			buf[pos+1] = '\''
737
+			buf[pos] = '\''
749
 			pos += 2
738
 			pos += 2
750
 		} else {
739
 		} else {
751
 			buf[pos] = c
740
 			buf[pos] = c
764
 	for i := 0; i < len(v); i++ {
753
 	for i := 0; i < len(v); i++ {
765
 		c := v[i]
754
 		c := v[i]
766
 		if c == '\'' {
755
 		if c == '\'' {
767
-			buf[pos] = '\''
768
 			buf[pos+1] = '\''
756
 			buf[pos+1] = '\''
757
+			buf[pos] = '\''
769
 			pos += 2
758
 			pos += 2
770
 		} else {
759
 		} else {
771
 			buf[pos] = c
760
 			buf[pos] = c
790
 // Lock is a no-op used by -copylocks checker from `go vet`.
779
 // Lock is a no-op used by -copylocks checker from `go vet`.
791
 func (*noCopy) Lock() {}
780
 func (*noCopy) Lock() {}
792
 
781
 
793
-// atomicBool is a wrapper around uint32 for usage as a boolean value with
794
-// atomic access.
795
-type atomicBool struct {
796
-	_noCopy noCopy
797
-	value   uint32
798
-}
799
-
800
-// IsSet returns whether the current boolean value is true
801
-func (ab *atomicBool) IsSet() bool {
802
-	return atomic.LoadUint32(&ab.value) > 0
803
-}
804
-
805
-// Set sets the value of the bool regardless of the previous value
806
-func (ab *atomicBool) Set(value bool) {
807
-	if value {
808
-		atomic.StoreUint32(&ab.value, 1)
809
-	} else {
810
-		atomic.StoreUint32(&ab.value, 0)
811
-	}
812
-}
813
-
814
-// TrySet sets the value of the bool and returns whether the value changed
815
-func (ab *atomicBool) TrySet(value bool) bool {
816
-	if value {
817
-		return atomic.SwapUint32(&ab.value, 1) == 0
818
-	}
819
-	return atomic.SwapUint32(&ab.value, 0) > 0
820
-}
782
+// Unlock is a no-op used by -copylocks checker from `go vet`.
783
+// noCopy should implement sync.Locker from Go 1.11
784
+// https://github.com/golang/go/commit/c2eba53e7f80df21d51285879d51ab81bcfbf6bc
785
+// https://github.com/golang/go/issues/26165
786
+func (*noCopy) Unlock() {}
821
 
787
 
822
 // atomicError is a wrapper for atomically accessed error values
788
 // atomicError is a wrapper for atomically accessed error values
823
 type atomicError struct {
789
 type atomicError struct {
824
-	_noCopy noCopy
825
-	value   atomic.Value
790
+	_     noCopy
791
+	value atomic.Value
826
 }
792
 }
827
 
793
 
828
 // Set sets the error value regardless of the previous value.
794
 // Set sets the error value regardless of the previous value.

+ 2
- 2
vendor/modules.txt View File

22
 github.com/ergochat/irc-go/ircmsg
22
 github.com/ergochat/irc-go/ircmsg
23
 github.com/ergochat/irc-go/ircreader
23
 github.com/ergochat/irc-go/ircreader
24
 github.com/ergochat/irc-go/ircutils
24
 github.com/ergochat/irc-go/ircutils
25
-# github.com/go-sql-driver/mysql v1.6.0
26
-## explicit; go 1.10
25
+# github.com/go-sql-driver/mysql v1.7.0
26
+## explicit; go 1.13
27
 github.com/go-sql-driver/mysql
27
 github.com/go-sql-driver/mysql
28
 # github.com/go-test/deep v1.0.6
28
 # github.com/go-test/deep v1.0.6
29
 ## explicit; go 1.13
29
 ## explicit; go 1.13

Loading…
Cancel
Save