mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
fix issue 1481. correctly escape api_key.key column name
'key' is a reserved word in mysql. So when building a query, the api-key.key column name needs to be escaped
This commit is contained in:
parent
6263ec1d38
commit
55ba8ad0c4
@ -66,7 +66,7 @@ func UpdateApiKey(cmd *m.UpdateApiKeyCommand) error {
|
||||
|
||||
func GetApiKeyByKey(query *m.GetApiKeyByKeyQuery) error {
|
||||
var apikey m.ApiKey
|
||||
has, err := x.Where("key=?", query.Key).Get(&apikey)
|
||||
has, err := x.Where("`key`=?", query.Key).Get(&apikey)
|
||||
|
||||
if err != nil {
|
||||
return err
|
||||
|
Loading…
Reference in New Issue
Block a user