From 0a9212f81573d983e25555225f60a3855e56fb31 Mon Sep 17 00:00:00 2001 From: wzc90 <108047478+wzc90@users.noreply.github.com> Date: Thu, 16 May 2024 07:37:42 +0800 Subject: [PATCH] fix: memo find for mysql(#3387) * Update memo.go * Update store/db/mysql/memo.go Co-authored-by: boojack --------- Co-authored-by: boojack --- store/db/mysql/memo.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/store/db/mysql/memo.go b/store/db/mysql/memo.go index 51431ba3..15b19dc6 100644 --- a/store/db/mysql/memo.go +++ b/store/db/mysql/memo.go @@ -91,7 +91,7 @@ func (d *DB) ListMemos(ctx context.Context, find *store.FindMemo) ([]*store.Memo where, args = append(where, "`memo`.`payload` = ?"), append(args, *v.Raw) } if v.Tag != nil { - where, args = append(where, "JSON_CONTAINS(JSON_EXTRACT(payload, '$.property.tags[*]'), ?, '$')"), append(args, *v.Tag) + where, args = append(where, "JSON_CONTAINS(JSON_EXTRACT(`memo`.`payload`, '$.property.tags'), ?)"), append(args, fmt.Sprintf(`["%s"]`, *v.Tag)) } } if find.ExcludeComments {