@@ -22,55 +22,55 @@ var testDSNs = []struct {
2222	out  * Config 
2323}{{
2424	"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 ,  CheckConnLiveliness :  true },
2626}, {
2727	"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 , CheckConnLiveliness :  true ,  ColumnsWithAlias : true },
2929}, {
3030	"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 , CheckConnLiveliness :  true ,  ColumnsWithAlias : true , MultiStatements : true },
3232}, {
3333	"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 ,  CheckConnLiveliness :  true },
3535}, {
3636	"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 , CheckConnLiveliness :  true ,  TLSConfig : "true" },
3838}, {
3939	"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 , CheckConnLiveliness :  true ,  TLSConfig : "skip-verify" },
4141}, {
4242	"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 , CheckConnLiveliness :  true ,  ClientFoundRows : true , MaxAllowedPacket : 16777216 , ParseTime : true , RejectReadOnly : true },
4444}, {
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&checkConnLiveliness=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 ,  CheckConnLiveliness :  false },
4747}, {
4848	"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 ,  CheckConnLiveliness :  true },
5050}, {
5151	"/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 ,  CheckConnLiveliness :  true },
5353}, {
5454	"@/" ,
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 ,  CheckConnLiveliness :  true },
5656}, {
5757	"/" ,
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 ,  CheckConnLiveliness :  true },
5959}, {
6060	"" ,
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 ,  CheckConnLiveliness :  true },
6262}, {
6363	"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 ,  CheckConnLiveliness :  true },
6565}, {
6666	"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 ,  CheckConnLiveliness :  true },
6868}, {
6969	"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 ,  CheckConnLiveliness :  true },
7171}, {
7272	"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 ,  CheckConnLiveliness :  true },
7474},
7575}
7676
0 commit comments