diff --git a/store/db/mysql/memo.go b/store/db/mysql/memo.go index 4fe928f95dde1..40549bc7f0c70 100644 --- a/store/db/mysql/memo.go +++ b/store/db/mysql/memo.go @@ -242,6 +242,9 @@ func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error { } set, args = append(set, "`payload` = ?"), append(args, string(payloadBytes)) } + if len(args) == 0 { + return nil + } args = append(args, update.ID) stmt := "UPDATE `memo` SET " + strings.Join(set, ", ") + " WHERE `id` = ?" diff --git a/store/db/postgres/memo.go b/store/db/postgres/memo.go index be4b35589b80c..268fb14417ef0 100644 --- a/store/db/postgres/memo.go +++ b/store/db/postgres/memo.go @@ -233,6 +233,9 @@ func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error { } set, args = append(set, "payload = "+placeholder(len(args)+1)), append(args, string(payloadBytes)) } + if len(args) == 0 { + return nil + } stmt := `UPDATE memo SET ` + strings.Join(set, ", ") + ` WHERE id = ` + placeholder(len(args)+1) args = append(args, update.ID) diff --git a/store/db/sqlite/memo.go b/store/db/sqlite/memo.go index a983a388dd787..87da7f19a15a1 100644 --- a/store/db/sqlite/memo.go +++ b/store/db/sqlite/memo.go @@ -220,6 +220,9 @@ func (d *DB) UpdateMemo(ctx context.Context, update *store.UpdateMemo) error { } set, args = append(set, "`payload` = ?"), append(args, string(payloadBytes)) } + if len(args) == 0 { + return nil + } args = append(args, update.ID) stmt := "UPDATE `memo` SET " + strings.Join(set, ", ") + " WHERE `id` = ?"