dendrite/syncapi/storage/postgres
Kiril Vladimiroff 59465746bc
Always defer *sql.Rows.Close and consult with Err
database/sql.Rows.Next() makes sure to call Close only after exhausting
result rows which would NOT happen when returning early from a bad Scan.
Close being idempotent makes it a great candidate to get always deferred
regardless of what happens later on the result set.

This change also makes sure call Err() after exhausting Next() and
propagate non-nil results from it as the documentation advises.

Closes #764

Signed-off-by: Kiril Vladimiroff <kiril@vladimiroff.org>
2020-02-06 11:27:24 +02:00
..
account_data_table.go Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
backward_extremities_table.go Some fixes for #847 (#850) 2020-01-24 11:40:27 +00:00
current_room_state_table.go Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
filtering.go Implement storage interfaces (#841) 2020-01-03 14:07:05 +00:00
invites_table.go Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
output_room_events_table.go Always defer *sql.Rows.Close and consult with Err 2020-02-06 11:27:24 +02:00
output_room_events_topology_table.go More sync fixes (#854) 2020-01-25 14:23:16 +00:00
syncserver.go More sync fixes (#854) 2020-01-25 14:23:16 +00:00