mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 06:22:13 +08:00
Chore: Remove mysqlParseTime feature toggle (#97761)
This commit is contained in:

committed by
GitHub

parent
db8ece3167
commit
f05d016ae7
@ -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{
|
||||
|
Reference in New Issue
Block a user