mirror of
https://github.com/yunionio/cloudpods.git
synced 2026-09-24 16:03:43 +08:00
避免mysql _ 是特殊字符问题
This commit is contained in:
@@ -288,7 +288,7 @@ func (manager *SMetadataManager) SetAll(ctx context.Context, obj IModel, store m
|
||||
}
|
||||
|
||||
records := []SMetadata{}
|
||||
q := manager.Query().Equals("id", idStr).NotLike("key", SYS_TAG_PREFIX+"%")
|
||||
q := manager.Query().Equals("id", idStr).NotLike("key", `\_\_%`) //避免删除系统内置的metadata, _ 在mysql里面有特殊含义,需要转义
|
||||
switch delRange {
|
||||
case TAG_DELETE_RANGE_USER:
|
||||
q = q.Like("key", USER_TAG_PREFIX+"%")
|
||||
|
||||
Reference in New Issue
Block a user