Alerting: fix ngalert alertmanager SQL Syntax Errors (#40827) (#40868)

* test kvstore in intregration tests with different databases

* escape 'key' in delete query

* export quote and use it in kvstore

(cherry picked from commit d1aefa1792)

Co-authored-by: Jean-Philippe Quéméner <JohnnyQQQQ@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2021-10-25 12:23:32 +02:00
committed by GitHub
co-authored by Jean-Philippe Quéméner
parent 543e9c2e50
commit 908a951fc0
3 changed files with 12 additions and 2 deletions
+5
View File
@@ -157,6 +157,11 @@ func (ss *SQLStore) Reset() error {
return ss.ensureMainOrgAndAdminUser()
}
// Quote quotes the value in the used SQL dialect
func (ss *SQLStore) Quote(value string) string {
return ss.engine.Quote(value)
}
func (ss *SQLStore) ensureMainOrgAndAdminUser() error {
ctx := context.Background()
err := ss.WithTransactionalDbSession(ctx, func(sess *DBSession) error {