Explorar o código

annotations: quote reserved fields (#9550)

krise3k %!s(int64=8) %!d(string=hai) anos
pai
achega
45a572ebd8
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      pkg/services/sqlstore/annotation.go

+ 1 - 1
pkg/services/sqlstore/annotation.go

@@ -43,7 +43,7 @@ func (r *SqlAnnotationRepo) ensureTagsExist(sess *DBSession, tags []*models.Tag)
 		var existingTag models.Tag
 		var existingTag models.Tag
 
 
 		// check if it exists
 		// check if it exists
-		if exists, err := sess.Table("tag").Where("key=? AND value=?", tag.Key, tag.Value).Get(&existingTag); err != nil {
+		if exists, err := sess.Table("tag").Where("`key`=? AND `value`=?", tag.Key, tag.Value).Get(&existingTag); err != nil {
 			return nil, err
 			return nil, err
 		} else if exists {
 		} else if exists {
 			tag.Id = existingTag.Id
 			tag.Id = existingTag.Id