mirror of
https://github.com/matrix-org/dendrite
synced 2024-11-10 07:04:24 +00:00
Fix issue where the EventReferenceSHA256 is not set
This commit is contained in:
parent
3bc4b357c6
commit
8ae34c4e5f
2 changed files with 6 additions and 2 deletions
|
@ -421,11 +421,13 @@ func (s *eventStatements) BulkSelectEventReference(
|
|||
defer internal.CloseAndLogIfError(ctx, rows, "bulkSelectEventReference: rows.close() failed")
|
||||
results := make([]gomatrixserverlib.EventReference, len(eventNIDs))
|
||||
i := 0
|
||||
var eventSHA []byte
|
||||
for ; rows.Next(); i++ {
|
||||
result := &results[i]
|
||||
if err = rows.Scan(&result.EventID, &result.EventSHA256); err != nil {
|
||||
if err = rows.Scan(&result.EventID, &eventSHA); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result.EventSHA256 = eventSHA
|
||||
}
|
||||
if err = rows.Err(); err != nil {
|
||||
return nil, err
|
||||
|
|
|
@ -457,11 +457,13 @@ func (s *eventStatements) BulkSelectEventReference(
|
|||
defer internal.CloseAndLogIfError(ctx, rows, "bulkSelectEventReference: rows.close() failed")
|
||||
results := make([]gomatrixserverlib.EventReference, len(eventNIDs))
|
||||
i := 0
|
||||
var eventSHA []byte
|
||||
for ; rows.Next(); i++ {
|
||||
result := &results[i]
|
||||
if err = rows.Scan(&result.EventID, &result.EventSHA256); err != nil {
|
||||
if err = rows.Scan(&result.EventID, &eventSHA); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
result.EventSHA256 = eventSHA
|
||||
}
|
||||
if i != len(eventNIDs) {
|
||||
return nil, fmt.Errorf("storage: event NIDs missing from the database (%d != %d)", i, len(eventNIDs))
|
||||
|
|
Loading…
Reference in a new issue