@@ -22,55 +22,55 @@ var testDSNs = []struct {
22
22
out * Config
23
23
}{{
24
24
"username:password@protocol(address)/dbname?param=value" ,
25
- & Config {User : "username" , Passwd : "password" , Net : "protocol" , Addr : "address" , DBName : "dbname" , Params : map [string ]string {"param" : "value" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
25
+ & Config {User : "username" , Passwd : "password" , Net : "protocol" , Addr : "address" , DBName : "dbname" , Params : map [string ]string {"param" : "value" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
26
26
}, {
27
27
"username:password@protocol(address)/dbname?param=value&columnsWithAlias=true" ,
28
- & Config {User : "username" , Passwd : "password" , Net : "protocol" , Addr : "address" , DBName : "dbname" , Params : map [string ]string {"param" : "value" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , ColumnsWithAlias : true },
28
+ & Config {User : "username" , Passwd : "password" , Net : "protocol" , Addr : "address" , DBName : "dbname" , Params : map [string ]string {"param" : "value" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true , ColumnsWithAlias : true },
29
29
}, {
30
30
"username:password@protocol(address)/dbname?param=value&columnsWithAlias=true&multiStatements=true" ,
31
- & Config {User : "username" , Passwd : "password" , Net : "protocol" , Addr : "address" , DBName : "dbname" , Params : map [string ]string {"param" : "value" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , ColumnsWithAlias : true , MultiStatements : true },
31
+ & Config {User : "username" , Passwd : "password" , Net : "protocol" , Addr : "address" , DBName : "dbname" , Params : map [string ]string {"param" : "value" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true , ColumnsWithAlias : true , MultiStatements : true },
32
32
}, {
33
33
"user@unix(/path/to/socket)/dbname?charset=utf8" ,
34
- & Config {User : "user" , Net : "unix" , Addr : "/path/to/socket" , DBName : "dbname" , Params : map [string ]string {"charset" : "utf8" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
34
+ & Config {User : "user" , Net : "unix" , Addr : "/path/to/socket" , DBName : "dbname" , Params : map [string ]string {"charset" : "utf8" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
35
35
}, {
36
36
"user:password@tcp(localhost:5555)/dbname?charset=utf8&tls=true" ,
37
- & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "localhost:5555" , DBName : "dbname" , Params : map [string ]string {"charset" : "utf8" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , TLSConfig : "true" },
37
+ & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "localhost:5555" , DBName : "dbname" , Params : map [string ]string {"charset" : "utf8" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true , TLSConfig : "true" },
38
38
}, {
39
39
"user:password@tcp(localhost:5555)/dbname?charset=utf8mb4,utf8&tls=skip-verify" ,
40
- & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "localhost:5555" , DBName : "dbname" , Params : map [string ]string {"charset" : "utf8mb4,utf8" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , TLSConfig : "skip-verify" },
40
+ & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "localhost:5555" , DBName : "dbname" , Params : map [string ]string {"charset" : "utf8mb4,utf8" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true , TLSConfig : "skip-verify" },
41
41
}, {
42
42
"user:password@/dbname?loc=UTC&timeout=30s&readTimeout=1s&writeTimeout=1s&allowAllFiles=1&clientFoundRows=true&allowOldPasswords=TRUE&collation=utf8mb4_unicode_ci&maxAllowedPacket=16777216&tls=false&allowCleartextPasswords=true&parseTime=true&rejectReadOnly=true" ,
43
- & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_unicode_ci" , Loc : time .UTC , TLSConfig : "false" , AllowCleartextPasswords : true , AllowNativePasswords : true , Timeout : 30 * time .Second , ReadTimeout : time .Second , WriteTimeout : time .Second , AllowAllFiles : true , AllowOldPasswords : true , ClientFoundRows : true , MaxAllowedPacket : 16777216 , ParseTime : true , RejectReadOnly : true },
43
+ & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_unicode_ci" , Loc : time .UTC , TLSConfig : "false" , AllowCleartextPasswords : true , AllowNativePasswords : true , Timeout : 30 * time .Second , ReadTimeout : time .Second , WriteTimeout : time .Second , AllowAllFiles : true , AllowOldPasswords : true , CheckConnLiveness : true , ClientFoundRows : true , MaxAllowedPacket : 16777216 , ParseTime : true , RejectReadOnly : true },
44
44
}, {
45
- "user:password@/dbname?allowNativePasswords=false&maxAllowedPacket=0" ,
46
- & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : 0 , AllowNativePasswords : false },
45
+ "user:password@/dbname?allowNativePasswords=false&checkConnLiveness=false& maxAllowedPacket=0" ,
46
+ & Config {User : "user" , Passwd : "password" , Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : 0 , AllowNativePasswords : false , CheckConnLiveness : false },
47
47
}, {
48
48
"user:p@ss(word)@tcp([de:ad:be:ef::ca:fe]:80)/dbname?loc=Local" ,
49
- & Config {User : "user" , Passwd : "p@ss(word)" , Net : "tcp" , Addr : "[de:ad:be:ef::ca:fe]:80" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .Local , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
49
+ & Config {User : "user" , Passwd : "p@ss(word)" , Net : "tcp" , Addr : "[de:ad:be:ef::ca:fe]:80" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .Local , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
50
50
}, {
51
51
"/dbname" ,
52
- & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
52
+ & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
53
53
}, {
54
54
"@/" ,
55
- & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
55
+ & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
56
56
}, {
57
57
"/" ,
58
- & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
58
+ & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
59
59
}, {
60
60
"" ,
61
- & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
61
+ & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
62
62
}, {
63
63
"user:p@/ssword@/" ,
64
- & Config {User : "user" , Passwd : "p@/ssword" , Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
64
+ & Config {User : "user" , Passwd : "p@/ssword" , Net : "tcp" , Addr : "127.0.0.1:3306" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
65
65
}, {
66
66
"unix/?arg=%2Fsome%2Fpath.ext" ,
67
- & Config {Net : "unix" , Addr : "/tmp/mysql.sock" , Params : map [string ]string {"arg" : "/some/path.ext" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
67
+ & Config {Net : "unix" , Addr : "/tmp/mysql.sock" , Params : map [string ]string {"arg" : "/some/path.ext" }, Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
68
68
}, {
69
69
"tcp(127.0.0.1)/dbname" ,
70
- & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
70
+ & Config {Net : "tcp" , Addr : "127.0.0.1:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
71
71
}, {
72
72
"tcp(de:ad:be:ef::ca:fe)/dbname" ,
73
- & Config {Net : "tcp" , Addr : "[de:ad:be:ef::ca:fe]:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true },
73
+ & Config {Net : "tcp" , Addr : "[de:ad:be:ef::ca:fe]:3306" , DBName : "dbname" , Collation : "utf8mb4_general_ci" , Loc : time .UTC , MaxAllowedPacket : defaultMaxAllowedPacket , AllowNativePasswords : true , CheckConnLiveness : true },
74
74
},
75
75
}
76
76
0 commit comments