From 731eee377d73d237c4cd68d330622c96d367c7e9 Mon Sep 17 00:00:00 2001 From: Maximilian Seifert Date: Tue, 26 Mar 2019 20:19:52 +0100 Subject: [PATCH] Fix error in "rowsToStreamEvent" Add columns device_id, transaction_id to select statement. This matches the subsequent call to Scan() and thus prevents the error. Signed-off-by: Maximilian Seifert --- syncapi/storage/output_room_events_table.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/syncapi/storage/output_room_events_table.go b/syncapi/storage/output_room_events_table.go index 8fbeb18c9..d4db04eb6 100644 --- a/syncapi/storage/output_room_events_table.go +++ b/syncapi/storage/output_room_events_table.go @@ -67,10 +67,12 @@ const insertEventSQL = "" + ") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10) RETURNING id" const selectEventsSQL = "" + - "SELECT id, event_json FROM syncapi_output_room_events WHERE event_id = ANY($1)" + "SELECT id, event_json, device_id, transaction_id" + + " FROM syncapi_output_room_events WHERE event_id = ANY($1)" const selectRecentEventsSQL = "" + - "SELECT id, event_json, device_id, transaction_id FROM syncapi_output_room_events" + + "SELECT id, event_json, device_id, transaction_id" + + " FROM syncapi_output_room_events" + " WHERE room_id = $1 AND id > $2 AND id <= $3" + " ORDER BY id DESC LIMIT $4"