Chore: Remove mysqlParseTime feature toggle (#97761)

This commit is contained in:
Stephanie Hingtgen
2024-12-10 14:13:13 -07:00
committed by GitHub
parent db8ece3167
commit f05d016ae7
10 changed files with 1 additions and 44 deletions

View File

@ -76,42 +76,30 @@ func TestInitEngine_ParseTimeInConnectionString(t *testing.T) {
name string
connectionString string
dbType string
featureEnabled bool
expectedConnection string
}{
{
name: "MySQL with parseTime already present",
connectionString: "mysql://user:password@localhost:3306/alreadypresent?parseTime=false",
dbType: "mysql",
featureEnabled: true,
expectedConnection: "user:password@tcp(localhost:3306)/alreadypresent?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&parseTime=false",
},
{
name: "MySQL with feature enabled",
connectionString: "mysql://user:password@localhost:3306/existingparams?charset=utf8",
dbType: "mysql",
featureEnabled: true,
expectedConnection: "user:password@tcp(localhost:3306)/existingparams?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&charset=utf8&parseTime=true",
},
{
name: "MySQL with feature enabled",
connectionString: "mysql://user:password@localhost:3306/existingparams?charset=utf8",
dbType: "mysqlWithHooks",
featureEnabled: true,
expectedConnection: "user:password@tcp(localhost:3306)/existingparams?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true&charset=utf8&parseTime=true",
},
{
name: "MySQL with feature disabled",
connectionString: "mysql://user:password@localhost:3306/disabled",
dbType: "mysql",
featureEnabled: false,
expectedConnection: "user:password@tcp(localhost:3306)/disabled?collation=utf8mb4_unicode_ci&allowNativePasswords=true&clientFoundRows=true",
},
{
name: "Postgres",
connectionString: "postgres://username:password@localhost:5432/mydatabase",
dbType: "postgres",
featureEnabled: true,
expectedConnection: "user=username host=localhost port=5432 dbname=mydatabase sslmode='' sslcert='' sslkey='' sslrootcert='' password=password",
},
}
@ -124,9 +112,6 @@ func TestInitEngine_ParseTimeInConnectionString(t *testing.T) {
require.NoError(t, err)
ftMgr := featuremgmt.WithFeatures()
if tt.featureEnabled {
ftMgr = featuremgmt.WithFeatures(featuremgmt.FlagMysqlParseTime)
}
ss := &SQLStore{
cfg: &setting.Cfg{