Unverified Commit 7ed3a12a authored by Viacheslav Potoropin's avatar Viacheslav Potoropin Committed by GitHub

fix: internal error on pin/unpin (#4332)

parent 5ec3150e
......@@ -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` = ?"
......
......@@ -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)
......
......@@ -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` = ?"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment