Chore: Enable ANSI_QUOTES for Mysql Database (#53277)

* remove the quote dialect

* add environment variable
This commit is contained in:
ying-jeanne
2022-08-08 11:14:17 -05:00
committed by GitHub
parent 732c22ed02
commit ba89471598
3 changed files with 17 additions and 1 deletions

View File

@@ -72,6 +72,12 @@ var sqlStoreTestCases = []sqlStoreTest{
dbURL: "://invalid.com/",
err: &url.Error{Op: "parse", URL: "://invalid.com/", Err: errors.New("missing protocol scheme")},
},
{
name: "Sql mode set to ANSI_QUOTES",
dbType: "mysql",
dbHost: "[::1]",
connStrValues: []string{"sql_mode='ANSI_QUOTES'"},
},
}
func TestIntegrationSQLConnectionString(t *testing.T) {
@@ -112,5 +118,7 @@ func makeSQLStoreTestConfig(t *testing.T, dbType, host, dbURL string) *setting.C
_, err = sec.NewKey("password", "pass")
require.NoError(t, err)
cfg.IsFeatureToggleEnabled = func(key string) bool { return true }
return cfg
}