Pass parseTime=true parameter to mysql driver (#112320)

* Pass parseTime=true parameter to mysql driver

* Fix tests.
This commit is contained in:
Peter Štibraný
2025-10-13 12:29:07 +02:00
committed by GitHub
parent add2ce75c8
commit f823e09e17
3 changed files with 9 additions and 9 deletions
@@ -31,7 +31,7 @@ var databaseConfigTestCases = []databaseConfigTest{
name: "MySQL IPv4",
dbType: "mysql",
dbHost: "1.2.3.4:5678",
expConnStr: ":@tcp(1.2.3.4:5678)/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true",
expConnStr: ":@tcp(1.2.3.4:5678)/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&parseTime=true",
},
{
name: "Postgres IPv4",
@@ -65,13 +65,13 @@ var databaseConfigTestCases = []databaseConfigTest{
name: "MySQL IPv4 (Default Port)",
dbType: "mysql",
dbHost: "1.2.3.4",
expConnStr: ":@tcp(1.2.3.4)/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true",
expConnStr: ":@tcp(1.2.3.4)/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&parseTime=true",
},
{
name: "MySQL IPv6",
dbType: "mysql",
dbHost: "[fe80::24e8:31b2:91df:b177]:1234",
expConnStr: ":@tcp([fe80::24e8:31b2:91df:b177]:1234)/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true",
expConnStr: ":@tcp([fe80::24e8:31b2:91df:b177]:1234)/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&parseTime=true",
},
{
name: "Postgres IPv6",
@@ -83,7 +83,7 @@ var databaseConfigTestCases = []databaseConfigTest{
name: "MySQL IPv6 (Default Port)",
dbType: "mysql",
dbHost: "[::1]",
expConnStr: ":@tcp([::1])/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true",
expConnStr: ":@tcp([::1])/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&parseTime=true",
},
{
name: "Postgres IPv6 (Default Port)",
@@ -101,7 +101,7 @@ var databaseConfigTestCases = []databaseConfigTest{
dbType: "mysql",
dbHost: "[::1]",
features: featuremgmt.WithFeatures(featuremgmt.FlagMysqlAnsiQuotes),
expConnStr: ":@tcp([::1])/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&sql_mode='ANSI_QUOTES'",
expConnStr: ":@tcp([::1])/test_db?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&parseTime=true&sql_mode='ANSI_QUOTES'",
},
}