[chore] bump bun v1.1.14 -> v1.1.15 (#2195)

This commit is contained in:
tobi 2023-09-11 15:16:52 +02:00 committed by GitHub
commit 7011f57b09
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
27 changed files with 273 additions and 90 deletions

View file

@ -271,10 +271,18 @@ func (q *UpdateQuery) mustAppendSet(fmter schema.Formatter, b []byte) (_ []byte,
switch model := q.tableModel.(type) {
case *structTableModel:
pos := len(b)
b, err = q.appendSetStruct(fmter, b, model)
if err != nil {
return nil, err
}
// Validate if no values were appended after SET clause.
// e.g. UPDATE users SET WHERE id = 1
// See issues858
if len(b) == pos {
return nil, errors.New("bun: empty SET clause is not allowed in the UPDATE query")
}
case *sliceTableModel:
return nil, errors.New("bun: to bulk Update, use CTE and VALUES")
default: