Changeset 509 in code for trunk/db.go


Ignore:
Timestamp:
Apr 27, 2021, 7:22:44 AM (4 years ago)
Author:
yyp
Message:

db: match placeholders with columns

Soju inserts 9 columns but only with 8 placeholders. This causes
channels not being saved properly and also logging errors like this:

downstream ...: failed to create or update channel ...: 8 values for 9 columns

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/db.go

    r497 r509  
    597597                var res sql.Result
    598598                res, err = db.db.Exec(`INSERT INTO Channel(network, name, key, detached, detached_internal_msgid, relay_detached, reattach_on, detach_after, detach_on)
    599                         VALUES (?, ?, ?, ?, ?, ?, ?, ?)`,
     599                        VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`,
    600600                        networkID, ch.Name, key, ch.Detached, toNullString(ch.DetachedInternalMsgID), ch.RelayDetached, ch.ReattachOn, detachAfter, ch.DetachOn)
    601601                if err != nil {
Note: See TracChangeset for help on using the changeset viewer.