Skip to content

Commit

Permalink
Merge branch 'devel' of https://github.com/tinode/chat into devel
Browse files Browse the repository at this point in the history
  • Loading branch information
or-else committed Apr 27, 2020
2 parents 8a89032 + a5616cd commit 7bf8116
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/db/mysql/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -2216,7 +2216,7 @@ func (a *adapter) MessageAttachments(msgId t.Uid, fids []string) error {
var values []string
strNow := t.TimeNow().Format("2006-01-02T15:04:05.999")
// createdat,fileid,msgid
val := "VALUES('" + strNow + "',?," + strconv.FormatInt(int64(msgId), 10) + ")"
val := "('" + strNow + "',?," + strconv.FormatInt(int64(msgId), 10) + ")"
for _, fid := range fids {
id := t.ParseUid(fid)
if id.IsZero() {
Expand All @@ -2239,7 +2239,7 @@ func (a *adapter) MessageAttachments(msgId t.Uid, fids []string) error {
}
}()

_, err = a.db.Exec("INSERT INTO filemsglinks(createdat,fileid,msgid) "+strings.Join(values, ","), args...)
_, err = a.db.Exec("INSERT INTO filemsglinks(createdat,fileid,msgid) VALUES "+strings.Join(values, ","), args...)
if err != nil {
return err
}
Expand Down

0 comments on commit 7bf8116

Please sign in to comment.