mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
escape reserved word (#40788)
This commit is contained in:
parent
80b4ef820a
commit
a5501b7845
@ -99,7 +99,7 @@ func (kv *kvStoreSQL) Del(ctx context.Context, orgId int64, namespace string, ke
|
|||||||
func (kv *kvStoreSQL) Keys(ctx context.Context, orgId int64, namespace string, keyPrefix string) ([]Key, error) {
|
func (kv *kvStoreSQL) Keys(ctx context.Context, orgId int64, namespace string, keyPrefix string) ([]Key, error) {
|
||||||
var keys []Key
|
var keys []Key
|
||||||
err := kv.sqlStore.WithDbSession(ctx, func(dbSession *sqlstore.DBSession) error {
|
err := kv.sqlStore.WithDbSession(ctx, func(dbSession *sqlstore.DBSession) error {
|
||||||
query := dbSession.Where("namespace = ?", namespace).And("key LIKE ?", keyPrefix+"%")
|
query := dbSession.Where("namespace = ?", namespace).And("\"key\" LIKE ?", keyPrefix+"%")
|
||||||
if orgId != AllOrganizations {
|
if orgId != AllOrganizations {
|
||||||
query.And("org_id = ?", orgId)
|
query.And("org_id = ?", orgId)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user